Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Error: No module named numpy

I have a very similar question to this question, but I am still one step behind. I have only one version of Python 3 installed on my Windows 7 (sorry) 64-bit system.

I installed NumPy following this link - as suggested in the question. The installation went fine but when I execute

import numpy

I got the following error:

Import error: No module named numpy

like image 266
Seb Avatar asked Oct 19 '11 08:10

Seb


4 Answers

You can simply use

pip install numpy

Or for python3, use

pip3 install numpy
like image 50
Andrei Madalin Butnaru Avatar answered Oct 18 '22 03:10

Andrei Madalin Butnaru


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
like image 24
unutbu Avatar answered Oct 18 '22 01:10

unutbu


Installing Numpy on Windows

  1. 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)
  2. 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.

  1. 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
like image 37
harshitha yendapally Avatar answered Oct 18 '22 01:10

harshitha yendapally


I think there are something wrong with the installation of numpy. Here are my steps to solve this problem.

  1. go to this website to download correct package: http://sourceforge.net/projects/numpy/files/
  2. unzip the package
  3. go to the document
  4. use this command to install numpy: python setup.py install
like image 17
Haimei Avatar answered Oct 18 '22 01:10

Haimei