I have a very similar question to this question, but still one step behind. I have only one version of Python 3 installed on my Windows 7 (sorry) 64-bit system.
You should try to install numpy using one of those:
pip install numpy
pip2 install numpy
pip3 install numpy
For some reason in my case pip2 solved the problem
If it was working before reinstalling python would solve the issue.
I just hit and resolved this issue using: How can I install a previous version of Python 3 in macOS using homebrew?
import numpy as np
ImportError: No module named numpy
I got this even though I knew numpy was installed and unsuccessfully tried all the advice above. The fix for me was to remove the as np and directly refer to modules . (python 3.4.8 on Centos) .
import numpy
DataTwo=numpy.stack((OutputListUnixTwo))...
For me, on windows 10, I had unknowingly installed multiple python versions (One from PyCharm IDE and another from Windows store). I uninstalled the one from windows Store and just to be thorough, uninstalled numpy pip uninstall numpy
and then installed it again pip install numpy
. It worked in the terminal in PyCharm and also in command prompt.
For those using python 2.7, should try:
apt-get install -y python-numpy
Instead of pip install numpy
As stated in other answers, this error may refer to using the wrong python version. In my case, my environment is Windows 10 + Cygwin. In my Windows environment variables, the PATH points to C:\Python38 which is correct, but when I run my command like this:
./my_script.py
I got the ImportError: No module named numpy
because the version used in this case is Cygwin's own Python version even if PATH environment variable is correct.
All I needed was to run the script like this:
py my_script.py
And this way the problem was solved.