user3576608
user3576608

Reputation: 61

ModuleNotFoundError: No module named 'numpy'

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

Answers (5)

Syed Yasir Ali
Syed Yasir Ali

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

Akhila M
Akhila M

Reputation: 51

If you are using PyCharm, open PyCharm and go to menu FileSettingProjectPython Interpreterclick on '+' → search and select the required package → install package.

Upvotes: 5

Balraj Ashwath
Balraj Ashwath

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

Scott
Scott

Reputation: 5858

You can simply install NumPy with pip:

pip install numpy

Upvotes: 0

NoaDeKoKo
NoaDeKoKo

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

Related Questions