所以我习惯打source activate <environment>
启动 python Anaconda 环境时。这工作得很好。但是当我创建新的 conda 环境时,我在 Ubuntu 16.04 上看到了使用 conda activate
启动环境的消息。反而。除了关于如何设置我的 shell 以使用 conda activate
的错误之外相反,我仍然不清楚 source activate ...
之间有什么区别和 conda activate ...
有改变的理由吗?有谁知道这两个命令之间的区别?谢谢。
最佳答案
从 conda 4.4 开始,conda activate
是激活环境的首选方式。通常,您不会发现 conda activate
和旧的 source activate
之间有太大区别,只是它的目的是更快,并且在不同的操作中工作相同系统(后一个差异使 conda activate
成为 IMO 巨大的 改进)。
来自 docs ,关于conda版本4.4.0
(2017年12月发布)的发布:
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.
关于Python python : should I use `conda activate` or `source activate` in linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49600611/