12

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

JoshAdel
  • 66,734
  • 27
  • 141
  • 140
penny
  • 131
  • 1
  • 1
  • 6

4 Answers4

7

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.

JoshAdel
  • 66,734
  • 27
  • 141
  • 140
  • 2
    Thanks, I Uninstall the python3.5 installed before, than I reinstall the Anaconda3. It works ! – penny Jul 13 '16 at 07:06
3

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
Shivam Mishra
  • 1,731
  • 2
  • 11
  • 29
3

First, remove the numpy from anaconda:

conda remove numpy

Then, install it back using pip

pip install numpy

This works for me.

  • 1
    why would you use pip to install numpy when you are using conda to manage your env. Just because it works doesnt mean that this is the correct answer. You should at least explain why it fixes the problem. – Xitcod13 Mar 06 '22 at 23:40
1

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.

earnshae
  • 169
  • 13
  • 1
    I did that and it kind of worked, but it also uninstalled a bunch of other packages that I now have to install manually. – fredq Nov 17 '20 at 21:35