Python Anaconda:我应该在Linux中使用"conda activate"还是"source Activate"
所以我习惯在启动python Anaconda环境时键入source activate <environment>
.那很好.但是,当我创建新的conda环境时,在Ubuntu 16.04上看到的消息是改为使用conda activate
启动环境.除了关于如何设置我的shell以使用conda activate
的错误外,我仍然不清楚source activate ...
和conda activate ...
之间的区别是什么?是否有理由更改?有谁知道这两个命令之间的区别?谢谢.
So I am used to typing source activate <environment>
when starting a python Anaconda environment. That works just fine. But when I create new conda environments I am seeing the message on Ubuntu 16.04 to start the environments with conda activate
instead. Besides the errors about how to set up my shell to use conda activate
instead, I am still not clear on what is the difference between source activate ...
and conda activate ...
Is there a reason to change? Does anyone know the difference between these two commands? Thanks.
从conda 4.4开始,conda activate
是激活环境的首选方法.通常,您会发现conda activate
与旧版source activate
之间的区别不会太大,只是它的速度更快,并且可以在不同的操作系统上运行相同(后者的区别使conda activate
成为巨大改进的IMO).
As of conda 4.4, conda activate
is the preferred way to activate an environment. Generally, you won't find too much of a difference between conda activate
and the old source activate
, except that it's meant to be faster, and work the same across different operating systems (the latter difference makes conda activate
a huge improvement IMO).
关于文档, conda版本4.4.0
的发布(2017年12月发布):
From the docs, regarding the release of conda version 4.4.0
(released December 2017):
conda activate:重新激活了环境激活的逻辑和机制.在conda 4.4中,conda activate和conda deactivate现在是激活和停用环境的首选命令.您会发现它们比以前的conda版本中的源代码激活和源代码停用命令更加活泼. conda activate命令还具有以下优点:(1)在所有OS,shell和平台上通用,并且(2)与其他包(例如python virtualenv的Activate脚本)的脚本没有路径冲突.
conda activate: The logic and mechanisms underlying environment activation have been reworked. With conda 4.4, conda activate and conda deactivate are now the preferred commands for activating and deactivating environments. You’ll find they are much more snappy than the source activate and source deactivate commands from previous conda versions. The conda activate command also has advantages of (1) being universal across all OSes, shells, and platforms, and (2) not having path collisions with scripts from other packages like python virtualenv’s activate script.