简体   繁体   English

如何使用Mac OS X在终端中激活Anaconda环境?

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

So I'm taking an online class and here are the instructions: 因此,我正在上在线课程,以下是说明:

Install Anaconda: 安装Anaconda:

Follow the instructions on the Anaconda download site. 请按照Anaconda下载网站上的说明进行操作。

Create a conda environment called tensorflow: 创建一个名为tensorflow的conda环境:

 # 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. 激活环境并使用conda或pip在其中安装TensorFlow。

So how do you activate the environment? 那么如何激活环境?

I have Mac OS X by the way. 顺便说一下,我有Mac OSX。

So how do you activate the environment? 那么如何激活环境?

I have Mac OS X by the way. 顺便说一下,我有Mac OSX。

On OS X, after creating the tensorflow environment using one of the commands from your example, execute: 在OS X上,使用示例中的命令之一创建张量tensorflow环境后,执行:

source activate tensorflow

to activate an environment with OSX, you enter source activate and then the environment name. 要使用OSX激活环境,请输入source activate ,然后输入环境名称。 for example 例如

source activate tensorflow

then when you type python , it will start that version of python. 然后当您键入python ,它将启动该版本的python。

Your question implies you named all your environments tensorflow . 您的问题意味着您将所有环境都命名为tensorflow You probably want to give them different names which indicate which version of python. 您可能想给他们提供不同的名称,以指示python的版本。

Then type source deactivate to deactivate the current environment. 然后键入source deactivate以禁用当前环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM