激活Anaconda3中的环境

时间:2016-12-01 06:27:56

标签: python virtualenv

我现在有3个环境:

[abigail@localhost anaconda3]$ conda info --envs
# conda environments:
#
mlearing                 /home/abigail/anaconda3/envs/mlearing
mlearning2               /home/abigail/anaconda3/envs/mlearning2
root                  *  /home/abigail/anaconda3

我想切换到env' mlearing':

[abigail@localhost anaconda3]$ source envs/mlearing/bin/activate 
(root) [abigail@localhost anaconda3]$ conda info --envs

但它看起来仍然坚持根env:

(root) [abigail@localhost anaconda3]$ conda info --envs
# conda environments:
#
mlearing                 /home/abigail/anaconda3/envs/mlearing
mlearning2               /home/abigail/anaconda3/envs/mlearning2
root                  *  /home/abigail/anaconda3

如何切换到其他环境?

2 个答案:

答案 0 :(得分:2)

Linux, OS X: source activate <environment_name>

Windows: activate <environment_name>

答案 1 :(得分:0)

你试过吗?

conda activate envname