5

So I'm taking an online class and here are the instructions:

Install Anaconda:

Follow the instructions on the Anaconda download site.

Create a conda environment called tensorflow:

# Python 2.7
$ conda create -n tensorflow python=2.7

# Python 3.4
$ conda create -n tensorflow python=3.4

# Python 3.5
$ conda create -n tensorflow python=3.5

Activate the environment and use conda or pip to install TensorFlow inside it.

So how do you activate the environment?

I have Mac OS X by the way.

techraf
  • 64,883
  • 27
  • 193
  • 198
C Hobbs
  • 59
  • 1
  • 2
  • 12
  • http://stackoverflow.com/questions/20081338/how-to-activate-an-anaconda-environment – maininformer Jan 01 '17 at 02:28
  • Since you changed the accepted answer, may I ask if the current marked one works properly for you? Or does it display an error `Error: activate must be sourced. Run 'source activate envname'` – techraf Sep 16 '17 at 02:14
  • Yes the current one works properly for me @techraf – C Hobbs Jun 02 '22 at 17:18

2 Answers2

9

So how do you activate the environment?

I have Mac OS X by the way.

On OS X, after creating the tensorflow environment using one of the commands from your example, execute:

source activate tensorflow
Community
  • 1
  • 1
techraf
  • 64,883
  • 27
  • 193
  • 198
3

to activate an environment with OSX, you enter source activate and then the environment name. for example

source activate tensorflow

then when you type python, it will start that version of python.

Your question implies you named all your environments tensorflow. You probably want to give them different names which indicate which version of python.

Then type source deactivate to deactivate the current environment.

mark jay
  • 1,256
  • 14
  • 23