如何从PowerShell激活不同的Anaconda环境 [英] How to activate different anaconda environment from powershell
问题描述
我在anaconda中有两个环境,分别是:root
,2env
.当我打开anaconda提示符时,可以通过键入activate 2env
从root
切换到2env
.我的powershell中也有conda,但是当我打开powershell并尝试运行conda activate 2env
时,会出现以下错误:
I have two environments in anaconda, namely: root
, 2env
. When I open anaconda prompt, I can switch from root
to 2env
by typing: activate 2env
. I also have conda in my powershell, but when I open powershell and try to run conda activate 2env
it gives the following error:
CommandNotFoundError:'激活'
CommandNotFoundError: 'activate'
关于如何解决此问题的任何建议?
Any suggestions on how to fix this?
推荐答案
Although Conda previously did not support PowerShell, this is now resolved in Conda 4.6.
将Anaconda3/Scripts/
添加到PATH变量后,您应该能够使用以下命令初始化供Powershell使用的Conda:
After adding Anaconda3/Scripts/
to your PATH variable, you should be able to initialize Conda for use with powershell with:
conda init powershell
此后,您可以正常使用conda
:
Afterwards, you can use conda
normally:
conda activate base
这篇关于如何从PowerShell激活不同的Anaconda环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!