如何从 powershell 激活 conda 环境? [英] How to activate conda environment from powershell?
问题描述
版本Anaconda 4.8.3
我不能做什么:
我无法从 powershell 激活任何环境.conda 激活基础
What I cannot do:
I can't activate any environment from powershell.
conda activate base
我能做什么:conda 环境列表
conda create -n xxx
conda remove -n xxx
我尝试了很多解决方案,但结果都没有用:
I have tried many solutions, but they turn out to be useless:
conda init powershell
重启powershell
conda 激活
conda init powershell
restart powershell
conda activate
conda update -n base conda
并重做 1
conda update -n base conda
and redo 1
conda install -n root -c pscondaenvs pscondaenvs
Set-ExecutionPolicy RemoteSigned
运行激活基地
推荐答案
您不需要管理员权限.
在 Windows 上安装 Anaconda 或 Miniconda 后,从开始"菜单打开 Anaconda Powershell Prompt
.
Once you install Anaconda or Miniconda on Windows, open a Anaconda Powershell Prompt
from Start Menu.
或者,如果你在那里没有看到它,那么假设你已经安装了路径 C:miniconda34.9.2 处的 miniconda3,执行:
Or, If you don't see it there, then assuming you have installed miniconda3 at path C:miniconda34.9.2, do:
powershell -ExecutionPolicy ByPass -NoExit -Command "& 'C:miniconda34.9.2shellcondabinconda-hook.ps1' ; conda activate 'C:miniconda34.9.2' "
现在试试:
conda init powershell
然后重新打开 powershell.
and reopen powershell.
补充说明:默认情况下,当我们打开终端时,conda 会自动激活.如果您不喜欢,请使用以下命令禁用自动激活:
Additional note: By default conda will autoactivate itself, when we open terminal. If you prefer not, then disable auto-activation with:
conda config --set auto_activate_base false
这篇关于如何从 powershell 激活 conda 环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!