首先查看自己的anaconda版本號:conda --version
Conda低於4.6版本:
- 用Win+X組合鍵調出PowerShell管理員模式;
- 輸入命令
conda install -n root -c pscondaenvs pscondaenvs安裝PSCondaEnvs包; - 輸入命令
Set-ExecutionPolicy RemoteSigned,在出現選項后輸入Y回車,更改PowerShell的安全策略。 - PowerShell中使用
activate 環境名激活環境,使用deactivate退出環境(注意:需要去掉原命令中開頭的conda)
Conda大於等於4.6版本:
- 用Win+X組合鍵調出PowerShell管理員模式;
- 輸入命令
conda init powershell - 關閉后重新打開一個powershell窗口輸入
conda activate 環境名激活環境,退出環境用conda deactivate
上述cmd同樣適用,powershell替換為cmd.exe即可。
附:conda升級命令
conda update conda
conda update anaconda
conda update anaconda-navigator //更新最新版本anaconda-navigator
conda update xxx //更新文件包
國外的源更新比較慢,可以選擇使用國內的鏡像,配置方法:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
