如何从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
运行 activate base
推荐答案
您不需要管理员权限.
在 Windows 上安装 Anaconda 或 Miniconda 后,从开始菜单打开 Anaconda Powershell Prompt
.
Once you install Anaconda or Miniconda on Windows, open a Anaconda Powershell Prompt
from Start Menu.
或者,如果你没有在那里看到它,那么假设你已经安装了miniconda3 在路径 C:\miniconda3\4.9.2,执行:
Or, If you don't see it there, then assuming you have installed miniconda3 at path C:\miniconda3\4.9.2, do:
powershell -ExecutionPolicy ByPass -NoExit -Command "& 'C:\miniconda3\4.9.2\shell\condabin\conda-hook.ps1' ; conda activate 'C:\miniconda3\4.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屋!