win环境下在anaconda创建新的环境之后,命令行激活环境:conda activate XXX,之后出现以下
CommandNotFoundError: Your shell has not been properly configured to use 'conda 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 <SHELL_NAME>:应该初始化以下’命令提示符‘,win环境下一般是cmd.exe
因此先执行
conda init cmd.exe
并且报错信息的最后一行提示需要关掉且重新打开命令行
所以按照提示照做之后
执行
conda activate XXX
问题解决