Anaconda 错误:CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. To initialize your shell, run

错误来源

安装好 anaconda 之后新建环境之后直接激活环境 conda activate myenv

错误原因

conda 自己已经写的很明白了:

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
  - 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'.

意思就是当前 shell 没激活 conda activate 命令,需要激活。

解决方法

激活命令
Windows:conda init <SHELL_NAME>
SHELL_NAME 替换成当前的shell名称,比如 Windows 一般是 conda init cmd.exe

Linux:一般是 source activate

踩坑记录

曾经天真的我只运行了 conda init,然后一直没激活成功。。

posted @ 2021-10-15 17:15  墨莲玦  阅读(13665)  评论(1)    收藏  举报