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,然后一直没激活成功。。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM