python - 如何从powershell激活不同的anaconda环境

标签 python powershell command-line anaconda conda

我在anaconda中有两个环境,分别是:root, 2env。当我打开 anaconda 提示时,我可以通过键入以下命令从 root 切换到 2env:activate 2env。我的 powershell 中也有 conda,但是当我打开 powershell 并尝试运行 conda activate 2env 它会出现以下错误:

CommandNotFoundError: 'activate'

关于如何解决这个问题有什么建议吗?

最佳答案

虽然 Conda 以前不支持 PowerShell,但现在已在 Conda 4.6 中解决.

Anaconda3/Scripts/ 添加到您的 PATH 变量后,您应该能够初始化 Conda 以与 powershell 一起使用:

conda init powershell

之后就可以正常使用conda了:

conda activate base

关于python - 如何从powershell激活不同的anaconda环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47800794/

相关文章:

python - tf.data API无法打印所有批处理

Matlab lsqcurvefit() 函数的 Python 等价性

command-line - Apple Quicktime Mov 文件通过命令行降低播放速度

python - 包含 'flexible' 模式的子集字符串行

powershell - 使用终端 Sublime Text 3 以管理员身份运行 Powershell

powershell - 使用PowerShell从文本文件中删除空行

powershell - 向 Word 文档添加标题?

linux - npm install 需要 sudo,sudo npm install 返回 command not found Ubuntu(使用 nvm)

linux - 在 bash 中迭代数据文件

python - 美汤刮一 table