如何激活 Anaconda 环境 [英] How to activate an Anaconda environment
问题描述
我使用的是 Windows 8,使用 Anaconda 1.7.5 64 位.
I'm on Windows 8, using Anaconda 1.7.5 64bit.
我创建了一个新的 Anaconda 环境
I created a new Anaconda environment with
conda create -p ./test python=2.7 pip
来自 C:PrTEMPvenv
.
这很有效(有一个包含新 Python 发行版的文件夹).conda 告诉我输入
This worked well (there is a folder with a new python distribution). conda tells me to type
激活 C:PRTEMPvenv est
激活环境,但是返回:
C:PRAnacondaenvs 中不存在名为C:PR empvenv est"的环境
如何激活环境?我做错了什么?
How can I activate the environment? What am I doing wrong?
推荐答案
如果发生这种情况,您需要为您的环境设置 PATH(以便它从环境和 Windows 上的 Scripts 中获取正确的 Python).
If this happens you would need to set the PATH for your environment (so that it gets the right Python from the environment and Scripts on Windows).
>
假设您使用以下命令创建了一个名为 py33 的环境:
Imagine you have created an environment called py33 by using:
conda create -n py33 python=3.3 anaconda
这里的文件夹默认创建在Anacondaenvs,所以需要设置PATH为:
Here the folders are created by default in Anacondaenvs, so you need to set the PATH as:
set PATH=C:Anacondaenvspy33Scripts;C:Anacondaenvspy33;%PATH%
现在它应该可以在命令窗口中工作了:
Now it should work in the command window:
activate py33
上面这行代码是 Windows 中的代码,通常出现在 Mac 和 Linux 的教程中:
The line above is the Windows equivalent to the code that normally appears in the tutorials for Mac and Linux:
$ source activate py33
更多信息:https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/8T8i11gO39U
`anaconda` 是否创建了一个单独的每个新环境的 PYTHONPATH 变量?
这篇关于如何激活 Anaconda 环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!