Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Error: No module named numpy Anaconda

I have a very similar question to this question. I have only one version of python 3.5 installed on my Windows 7 64-bit system. I installed Anaconda3.4 via official website - as suggested in the question. The installation went fine but when I want to import(I just typing python from the command line )

import numpy

Import error:No module named numpy

Then I exit and type

pip install numpy 

Requirement already satisfied (use --upgrade to upgrade): numpy in d:\program fi les\anaconda3\lib\site-packages

I know this is probably a super basic question, but I'm still learning... Thanks

like image 378
penny Avatar asked Jul 12 '16 12:07

penny


4 Answers

If you are using Anaconda3 then you should already have numpy installed. There is no reason to use pip. My guess is that the Anaconda distribution is possibly not on your path and you are picking up some other system python.

You should run where python (or where python3) to see which one you are using. If the executable is not in the Anaconda install, then that is your problem and you will need to edit your path environment variable to ensure that you are opening the python you want.

like image 96
JoshAdel Avatar answered Sep 18 '22 14:09

JoshAdel


Anaconda installs python with it so whenever you are running python, you need to make sure you are using the one which anaconda installed. Use this command to know which python executable you are using right now. Keep the one installed by anaconda(typically inside anaconda folder) and uninstall any other.

    where python
like image 23
Shivam Mishra Avatar answered Sep 18 '22 14:09

Shivam Mishra


It is possible that numpy is not installed in the virtual environment that you are using at runtime, but may be installed as part of the global anaconda install.

From the terminal first activate the enviroment.

$ source activate {your environment name}

Then install numpy with conda install

$ conda install numpy

I found that this was the case with an environment that I had created with pycharm.

Installing it locally corrected the issue.

like image 37
earnshae Avatar answered Sep 17 '22 14:09

earnshae


First, remove the numpy from anaconda:

conda remove numpy

Then, install it back using pip

pip install numpy

This works for me.

like image 45
vlbthambawita Avatar answered Sep 18 '22 14:09

vlbthambawita