1

I tried importing numpy to carry out some array operations in Python:

import numpy *

But I got this error message:

ModuleNotFoundError: No module named 'numpy'

What do i do??

Scott
  • 3,608
  • 5
  • 31
  • 50
user3576608
  • 21
  • 1
  • 1
  • 3
  • 2
    [the official installation instructions](https://docs.scipy.org/doc/numpy/user/install.html) may be of use. – Him Jan 03 '20 at 08:10
  • 2
    You have not installed numpy module or you are using the wrong python installation. – Frieder Jan 03 '20 at 08:13
  • 1
    Possible dublicate of https://stackoverflow.com/questions/7818811/import-error-no-module-named-numpy – Scott Jan 03 '20 at 08:16

5 Answers5

3

If you are using PyCharm, open Pycharm Go to File->Setting->Project->Python Interpreter->Click on '+'->search and select required package->install package

Akhila M
  • 31
  • 2
1

Numpy doesn't seems installed on your computer, you can use this command to install it:

python -m pip install --user numpy

or you can check the installation guide for your distribution here: install SciPy

NoaDeKoKo
  • 66
  • 5
1

Use following command pip3 install numpy You will get the following response. You see the location.

Use the following as PATH as per direction explained in the previous post.

Requirement already satisfied: numpy in c:\users\-user name-\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (1.20.1)

numpy is installed here, not in "scripts".

Roshin Raphel
  • 2,478
  • 3
  • 18
  • 34
0

You can simply install numpy with pip:

pip install numpy
Scott
  • 3,608
  • 5
  • 31
  • 50
0

Install Numpy with pip install numpy command (ignore if already installed)

Import numpy in either of the three ways:

  • import numpy
  • import numpy as np
  • from numpy import *
Balraj Ashwath
  • 1,307
  • 2
  • 12
  • 19