conda activate和source activate 区别,以及使用出现的问题

上网查找了一下,发现是版本更新后出现的两条指令,现在使用conda 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.
翻译:
conda activate:环境激活的逻辑和机制已经被重新设计。在conda4.4中,condaactivate和condadeactivate现在是激活和停用环境的首选命令。您会发现它们比以前conda版本中的source activate和source deactivate命令要快得多。condaactivate命令还有以下优点:(1)在所有操作系统、shell和平台上都是通用的;(2)与来自其他包(如pythonvirtualenv的activate脚本)的脚本没有路径冲突。

顺便提一句,我在使用中出现了如下问题:
报错:CommandNotFoundError: Your shell has not been properly configured to use 'conda deactivate'.
原因是我上一次使用了source activate激活环境后,直接关闭了终端窗口,没有使用source deactivate 退出,因此现在不能使用conda activate 激活我想用的环境,因此只能先执行source deactivate或者conda deactivate(最好两个指令都依次试一下,很玄学),接着就能从新使用source activate命令啦

  • 21
    点赞
  • 44
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值