简体   繁体   中英

ModuleNotFoundError: No module named 'numpy'; but numpy installed

NumPy installed via pip in Windows 7 64 bit, Python3.

When trying to run code in console (Far manager) I have an error:

Traceback (most recent call last):
 File "[path]\X.py", line 42, in <module>
  import numpy
ModuleNotFoundError: No module named 'numpy'

Tried to install numpy but failed, because already installed

pip install numpy

Requirement already satisfied: numpy in c:\\program files (x86)\\python37-32\\lib\\site-packages (1.17.0)

This is exactly the right folder, all other libraries work in it correctly. Tried to uninstall numpy and then install again via pip but nothing changed.

Checking Python version python -- version

Python 3.7.3

Checking pip version pip -V

pip 19.2.1 from c:\\program files (x86)\\python37-32\\lib\\site-packages\\pip (python 3.7)

There is no other Python version on my computer. I'm not sure but maybe numpy used to work before I installed matplotlib (via pip, of course).

Thanks.

I was wrong, there was another Python version, 64-bit, in the Visual Studio folder. Uninstalled it and now problem fixed. Thanks everyone, especially @Praind.

The PyPi numpy package which is automatically downloaded by pip does not install correctly on Windows 7. I usually recommend that people install Python using the Anaconda distribution because it comes with numpy pre-installed.

Since you already have python installed, you can download the numpy wheel from Christoph Gohlke's page and install it that way. Be sure to use pip to uninstall the current non-working version first.

Have a look at this SO question , and specifically this answer for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM