解决CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’

问题

当使用conda时遇到报错

 conda activate baseCommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run$ conda init Currently supported shells are:- bash- fish- tcsh- xonsh- zsh- powershellSee 'conda init --help' for more information and options.IMPORTANT: You may need to close and restart your shell after running 'conda init'.

解决方法

按照提示执行命令conda init bash,新开一个窗口,看下是否成功。

若不成功,可能是因为conda配置问题,按照以下步骤进行解决:

  1. 执行source activate
  2. 执行source deactivate
  3. 执行conda activate env_name(你的环境名称),查看是否成功
  4. 将命令加入到~/.bashrc文件中,每次自动执行
source activate
source deactivate	


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部