3

I have conda and python 3.5 on Windows 7. I am working in virtual environment (activate tensorflow). I successfully executed

pip install numpy 
conda install numpy

When I ran

import numpy as np

I get back:

ImportError: No module named 'numpy'

What is wrong?

Update:

Here are some troubleshooting steps (all ran in virtual environment):

where conda

returns:

C:\Users\some_user\AppData\Local\conda\conda\envs\tensorflow\Scripts\conda
C:\Users\some_user\AppData\Local\conda\conda\envs\tensorflow\Scripts\conda.b
at
C:\ProgramData\Anaconda3\Scripts\conda.exe



where python

returns:

C:\Users\some_user\AppData\Local\conda\conda\envs\tensorflow\python.exe



where pip 

returns:

C:\Users\some_user\AppData\Local\conda\conda\envs\tensorflow\Scripts\pip.exe
user1700890
  • 7,144
  • 18
  • 87
  • 183

1 Answers1

2

You said you have two virtual environments, as I pointed out in my comment, this could help:

  1. Activate your env conda activate tensorflow
  2. Install numpy conda install numpy

Source: https://stackoverflow.com/a/41802528/1612432

Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
  • 1
    I don't think `root` is environment. `root` is base case. It is always active. On windows 7 I normally run `activate tensorflow`, and I aready did `conda install numpy` – user1700890 Apr 24 '19 at 14:39
  • 1
    Use `conda activate tensorflow` instead of `source activate tensorflow`. I have just tried to create an empty environment and executed the steps above and worked. – Alejandro Alcalde Apr 24 '19 at 14:41
  • 1
    `conda activate tensorflow` returns `CommanNotFoundError: 'activate'` – user1700890 Apr 24 '19 at 14:59
  • 2
    Something was wrong with my old virtual environment. I created new one and everything worked. – user1700890 Apr 24 '19 at 15:27