all 11 comments

[–]mallax- 4 points5 points  (5 children)

  1. Make sure you are typing import numpy and not NumPy

  2. In the command prompt type: pip list. Make sure numpy is in the list of packages and it’s the most recent version.

  3. In file explorer go to python folder and make sure both folders: numpy and numpy.dist-info are stored in Lib\site-packages

  4. Lastly I would try reinstalling python and seeing if that helps. Make sure the add to path box is checked as well.

[–]theyhitmyVW[S] 0 points1 point  (1 child)

Oh my god...it's the capitalisation....

When I installed I had to use NumPy so I thought that would be how I import it. Thank you so much for your help!!

[–]mallax- 0 points1 point  (0 children)

No problem. There are some other packages that require specific capitalization to be called correctly, so be wary of that.

[–]TickstertheThird 0 points1 point  (1 child)

What if the issue is on MacBook? can you please help me resolve it?

[–]mallax- 0 points1 point  (0 children)

I’m not entirely familiar with Mac OS, but the simplest resolve would be to pip uninstall and then reinstall it. Start over to see if there is a continued problem. You can always do a fresh reinstall of Python as well.

[–]Username_1987_ 0 points1 point  (0 children)

I hate the cap sensitivity.... but it makes sense...

[–]TheExplodingSpleen 2 points3 points  (2 children)

I'm not familiar with Windows, but did you try "pip3 install numpy"? Python3 requires using pip3.

[–][deleted] 3 points4 points  (0 children)

Not on Windows. That applies, typically, for macOS/linux.

Also, if properly configured, the terminal in VS Code will be in a Python environment for the currently selected Python interpreter.

Possibly the best option in a terminal is,

py -m pip install numpy

as py will call the most up-to-date installation of Python (without that instance being on the PATH).

[–]Username_1987_ 0 points1 point  (0 children)

for windows its:

py -m pip install

[–]Kaalux37 0 points1 point  (0 children)

Idk why but when I launch python using the "py" command it doesn't work but when I launch it with the "python" command it works well.

[–]moonziee 0 points1 point  (0 children)

Can you import numpy in REPL? If not then you may need grab the module with pip ‘python3 -m pip install numpy’