Kyle Bitterfield
Kyle Bitterfield

Reputation: 13

Error activating Conda environment in Windows

I was attempting to use anaconda to download tensorflow. I followed the guide character by character. Anaconda downloaded and installed. I used the command:

c:>conda create -n tensorflow python=3.5

which worked, then I used:

c:> activate tensorflow 

Which failed to change to a # prompt. So I tried using pip install and got an error message:

'pip' is not recognized as an internal or external command, operable program or batch file.

Does anyone have any suggestions on how to correct this?

Upvotes: 1

Views: 3463

Answers (3)

Shawn
Shawn

Reputation: 51

Run Anaconda Prompt as an administrator

I just have the same problem and by this way it's fixed.

Upvotes: 0

SherylHohman
SherylHohman

Reputation: 17960

Did you mean to use:
conda create -n tensorflow tensorflow python=3.5

the conda command:
conda install -n <env_name> <package>

translates your code
conda install -n tensorflow pythong-3.5
tells conda to:
- create a new environment,
- that you want your new environment to be named tensorflow, and to
- install python version 3.5 in the environment you just created.

You did not actually tell conda to install TensorFlow.

Personally, I prefer to name my environment, then change into it to install packages:

conda create -n new_env_name python=3.5 
source activate new_env_name
conda install tensorflow numpy pandas matplotlib  

* Note: if you are on Windows, you may need to use activate my_env_name instead of source activate my_env_name to start your environment.
Which command to use is dependent on what terminal window you are using:
- Powershell requires activate my_env_name,
- Git Bash requires source activate my_env_name.
Often instructions naively state the the former is always used when on a Windows system.

Upvotes: 1

SherylHohman
SherylHohman

Reputation: 17960

Try source activate tensorflow.

On mac and in some windows environments source activate <env_name> is required. activate <env_name> is used instead in some Windows' environments.

For example, on Windows, if you're in a Git Bash terminal window, you must use source activate <env_name>, but if you're in a Powershell terminal window, then activate <env_name> would be required.

Linux/Mac will always (so far as I know) require source activate <env_name>

Upvotes: 0

Related Questions