在win10创建了虚拟环境后,用“conda activate 虚拟环境名”,出现如下错误:
CommandNotFoundError: Your shell has not been properly configured to use 'conda deactivate'.
If using 'conda deactivate' from a batch script, change your
invocation to 'CALL conda.bat deactivate'.
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'.
解决方法:
直接输入“activate 虚拟环境名”进入虚拟环境,输入“deactivate 虚拟环境名”退出虚拟环境。
参考:conda activate激活环境出错的解决办法