如何从PowerShell激活不同的Anaconda环境 [英] How to activate different anaconda environment from powershell

查看:849
本文介绍了如何从PowerShell激活不同的Anaconda环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在anaconda中有两个环境,分别是:root2env.当我打开anaconda提示符时,可以通过键入activate 2envroot切换到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?

推荐答案

尽管Conda以前不支持PowerShell,但现在已在

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆