1

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?

SherylHohman
  • 12,507
  • 16
  • 70
  • 78
  • Make sure the path to your Anaconda binaries is in your PATH system variable. – Santiago Benoit Aug 03 '17 at 03:44
  • how do I do that? – Kyle Bitterfield Aug 03 '17 at 03:56
  • Which OS are you using ? – SherylHohman Aug 03 '17 at 04:14
  • Clarification: once you are inside your `tensorflow` environment) `conda install tensorflow` would be the command for actually downloading/installing TensorFlow. `conda create tensorflow` simply creates an environment that you decided to call `tensorflow`, and `activate tensorflow` or `source activate tensorflow` (depending on which OS/terminal window you are in) is used to start that environment. My understanding of your question is that you cannot activate your conda environment, (called `tensorflow`) hence downloading/installing TensorFlow isn't working ? – SherylHohman Aug 03 '17 at 04:23
  • Here as SO answer to editing your PATH variable https://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows. Otherwise, I'd suggest a Google search, as there are several methods. – SherylHohman Aug 03 '17 at 05:54
  • Sometimes with anaconda you have to update python once and it will instal pip, setuptools etc. properly then. Not sure why this is sometimes the case but i've found that. I also do NOT recommend using `conda install tensorflow` as @SherylHohman suggests. You should use pip to install tensorflow. – JCooke Aug 03 '17 at 14:14
  • @JCooke That was what I origionally attempted, but was unable to do. – Kyle Bitterfield Aug 03 '17 at 18:44
  • It could be that pip isn't installed or updated as it sometimes happens. Try `conda update python` and see what happens/ It might suggest installing pip alongside some other tools – JCooke Aug 04 '17 at 09:52

3 Answers3

1

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.

SherylHohman
  • 12,507
  • 16
  • 70
  • 78
0

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>

SherylHohman
  • 12,507
  • 16
  • 70
  • 78
0

Run Anaconda Prompt as an administrator

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

Shawn
  • 31
  • 1