How do you activate an Anaconda environment in the Terminal with Mac OS X?

时间:2017-01-01 02:00:21

标签: python macos anaconda

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.

2 个答案:

答案 0 :(得分:2)

  

那么你如何激活环境?

     

顺便说一下,我有Mac OS X.

在OS X上,在使用示例中的一个命令创建tensorflow环境后,执行:

source activate tensorflow

答案 1 :(得分:1)

要使用OSX激活环境,请输入source activate,然后输入环境名称。例如

source activate tensorflow

然后当你输入python时,它将启动那个版本的python。

您的问题意味着您将所有环境命名为tensorflow。您可能希望为它们指定不同的名称,以指示哪个版本的python。

然后键入source deactivate以停用当前环境。