Reputation: 61
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?
Upvotes: 5
Views: 36645
Reputation: 31
Use the 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".
Upvotes: 3
Reputation: 51
If you are using PyCharm, open PyCharm and go to menu File → Setting → Project → Python Interpreter → click on '+' → search and select the required package → install package.
Upvotes: 5
Reputation: 1437
Install NumPy with the 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 *
Upvotes: 0
Reputation: 96
NumPy doesn't seem to be installed on your computer, but 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
Upvotes: 2