Import Error: No module named numpy
Solution 1:
You can simply use
pip install numpy
Or for python3, use
pip3 install numpy
Solution 2:
Support for Python 3 was added in NumPy version 1.5.0, so to begin with, you must download/install a newer version of NumPy.
Or simply using pip
:
python3 -m pip install numpy
Solution 3:
Installing Numpy on Windows
- Open Windows command prompt with administrator privileges (quick method: Press the Windows key. Type "cmd". Right-click on the suggested "Command Prompt" and select "Run as Administrator)
- Navigate to the Python installation directory's Scripts folder using the "cd" (change directory) command. e.g. "cd C:\Program Files (x86)\PythonXX\Scripts"
This might be: C:\Users\\AppData\Local\Programs\Python\PythonXX\Scripts or C:\Program Files (x86)\PythonXX\Scripts (where XX represents the Python version number), depending on where it was installed. It may be easier to find the folder using Windows explorer, and then paste or type the address from the Explorer address bar into the command prompt.
- Enter the following command: "pip install numpy".
You should see something similar to the following text appear as the package is downloaded and installed.
Collecting numpy
Downloading numpy-1.13.3-2-cp27-none-win32.whl (6.7MB)
100% |################################| 6.7MB 112kB/s
Installing collected packages: numpy
Successfully installed numpy-1.13.3
Solution 4:
I think there are something wrong with the installation of numpy. Here are my steps to solve this problem.
- go to this website to download correct package: http://sourceforge.net/projects/numpy/files/
- unzip the package
- go to the document
- use this command to install numpy:
python setup.py install
Solution 5:
I also had this problem (Import Error: No module named numpy) but in my case it was a problem with my PATH variables in Mac OS X. I had made an earlier edit to my .bash_profile file that caused the paths for my Anaconda installation (and others) to not be added properly.
Just adding this comment to the list here in case other people like me come to this page with the same error message and have the same problem as I had.