在win10下面安装了虚拟环境 当执行 conda activate XXX
的时候报错: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'.
找了很多资料 有的说 执行 :conda init cmd.exe
有的说执行:先执行activate
进入虚拟环境后再执行conda activate XXX
上面这些都没有起作用。
最后其实只要去掉 conda
直接执行 activate XXX
就可以了。