Python python : should I use `conda activate` or `source activate` in linux

标签 python anaconda conda

所以我习惯打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/

相关文章:

python - argparse 和 ConfigParser 字符串替换语法从何而来?

python - 使用带有关键字参数的 multiprocessing.Pool.map() 函数?

python - conda 错误 : Downloaded bytes did not match Content-Length while trying to download cudnn using conda

python - 我的用户配置文件中的Ubuntu 16.04默认python环境是Anaconda Python2,无法运行guake "anaconda2/bin/python2: No module named guake"

anaconda - 使用 anaconda 3.6 安装 VTK

python - 使用 conda 安装 opencv

python - 覆盖范围未显示 virtualenv 中执行的行

python - 此 pandas select 语句的简短形式

python - 使用 conda 获取大小写正确的 cx_Oracle

shell - 激活 conda 失败(采购 ~/.bashrc)