CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'解决方法
一、问题描述
在安装好anaconda后第一次新建虚拟环境激活时,出现该错误,详细错误如下所示:
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 activate
命令。运行 conda init
:根据错误提示,且我这里使用的是cmd,所以使用conda init cmd.exe
命令
之后关闭命令行,重新打开输入激活命令即可。