Import error: no module named numpy

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

I installed numpy by following this link as suggested in the question. Installation went fine, but when I do

import numpy 

I got the following error:

Import error: no module named numpy

I know this is probably a very simple question, but I'm still participating.

thank

+159
python import numpy scipy
Oct 19 2018-11-11T00:
source share
19 answers

Python 3 support was added in NumPy version 1.5.0 , so first you need to download / install a new version of NumPy.

+49
Oct 19 2018-11-11T00:
source share

You can just use

 pip install numpy 

Or for python3 use

 pip3 install numpy 
+210
Feb 18 '16 at 8:51
source share

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

+15
Dec 09 '13 at 15:49
source share

I also had this problem (Import error: no module named numpy), but in my case it was a problem with my PATH variables on Mac OS X. I made an earlier change to my .bash_profile file, which caused the paths for my installation Anaconda (and others) will not be added properly.

Just adding this comment to the list here if other people like me come to this page with the same error message and have the same problem as me.

+11
May 02 '15 at 18:17
source share

You have installed the Numpy version for Python 2.6 - so you can only use it with Python 2.6. You must install Numpy for Python 3.x, for example. that one: http://sourceforge.net/projects/numpy/files/NumPy/1.6.1/numpy-1.6.1-win32-superpack-python3.2.exe/download

An overview of the various versions is available here: http://sourceforge.net/projects/numpy/files/NumPy/1.6.1/

+7
Oct 19 '11 at 8:59
source share

I also had a problem when I installed Numpy. I solved this by simply closing the Python interpreter and opening it again. It might be something else to try, if anyone else has this problem, it might save a few minutes!

+7
Mar 15 2018-12-15T00:
source share

1) Install numpy through the command line (in windows) 2) go to the scripts folder and enter the command below

C: \ Python27 \ Scripts> pip install numpy

Installation starts as follows: Collecting numpy Download 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

+5
Nov 13 '17 at 3:10
source share

Faced the same problem

 ImportError: No module named numpy 

So, in our case (we use PIP and python 2.7), the solution was SPLIT of pip install command:

FROM

 RUN pip install numpy scipy pandas sklearn 

AT

 RUN pip install numpy scipy RUN pip install pandas sklearn 

The solution is found here: https://github.com/pandas-dev/pandas/issues/25193 , it is associated with the latest update of pandas to v0.24.0

+5
Feb 12 '19 at 13:39
source share

I installed numpy in the same environment using pip and conda, and simply uninstalling and reinstalling either was not enough.

I had to reinstall both.

I don’t know why this happened suddenly, but the decision was

 pip uninstall numpy conda uninstall numpy 

removal from conda also removed torch and torchvision .

then

 conda install pytorch-cpu torchvision-cpu -c pytorch 

as well as

 pip install numpy 

this solved the problem for me.

+4
Dec 22 '18 at 12:56
source share

I'm not sure why I got the error, but pip3 uninstall numpy , then pip3 install numpy solved the problem for me.

+3
Feb 25 '17 at 14:12
source share

To install NumPy through Anaconda (use the commands below):

  • conda install -c conda-forge numpy
  • conda install -c conda-forge / label / broken numpy
+3
Nov 01 '17 at 4:32 on
source share

I also ran into the above problem with phyton 3 when setting up python for machine learning.

I have completed the following steps: -

Install python-2.7.13.msi

β€’ set PATH = C: \ Python27

β€’ set PATH = C: \ Python27 \ Scripts

Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

Downloaded: - - numpy-1.13.1 + mkl-cp27-cp27m-win32.whl

  --scipy-0.18.0-cp27-cp27m-win32.whl 

Numpy installation: pip install numpy-1.13.1 + mkl-cp27-cp27m-win32.whl

Install scipy: pip install scipy-0.18.0-cp27-cp27m-win32.whl

You can check the correctness using below cmds: -

 >>> import numpy >>> import scipy >>> import sklearn >>> numpy.version.version '1.13.1' >>> scipy.version.version '0.19.1' >>> 
+2
Sep 27 '17 at 5:58 on
source share

Those using xonsh do xpip install numpy .

+2
Feb 15 '18 at 4:36
source share

For those using Python 2.7, you should try:

 apt-get install -y python-numpy 

Instead of pip, install numpy

+2
Jul 29 '19 at 19:05
source share

This is a numpy version issue, please check $ CAFFE_ROOT / python / requirements.txt. Then exec: sudo apt-get install python-numpy> = xxx, this problem will be disabled.

+1
May 11 '16 at
source share
 import numpy as np ImportError: No module named numpy 

I got this, although I knew that numpy was installed and tried all the tips above unsuccessfully. The fix for me was to remove as np and directly access the module. (python 3.4.8 on Centos).

 import numpy DataTwo=numpy.stack((OutputListUnixTwo))... 
+1
Jun 29 '18 at 12:35
source share

After trying a lot of suggestions from different sites and similar questions, I needed to remove all Python materials and reinstall Anaconda (see https://stackoverflow.com/a/1647591/ ... )

The previous Python installation I had was not only redundant, but only caused me problems.

0
Oct 05 '18 at 23:24
source share

You can try:

py -3 -m pip install anyPackageName

In your case, use:

py -3 -m pip install numpy

thank

0
Sep 14 '19 at 5:14
source share

pip install numpy scipy pandas might work

-3
May 30 '17 at 17:49
source share



All Articles