用 Anaconda的指令 conda activate 遇到了错误提示。
CommandNotFoundError: Your shell has not been properly configured to
use ‘conda activate’. If using ‘conda activate’ from a batch script,
change your invocation to ‘CALL conda.bat activate’.To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- xonsh
- zsh
- powershell
See ‘conda init --help’ for more information and options.
IMPORTANT: You may need to close and restart your shell after running
‘conda init’.
前前后后查了很多方法,试过conda init cmd.exe 、source activate、试过配置多两个环境。最终在一篇关于vscode teminal powershell 的文章中找到解决方案。
解决方案
步骤一:
在Anaconda powershell prompt 中执行
conda init powershell