CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'

当使用conda activate my_env激活环境时,可能会遇到如下错误:

    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'

在执行'conda init'也没有作用时,可以尝试如下方法:

source ~/anaconda3/etc/profile.d/conda.sh
conda activate my_env

有时可能需要查看anaconda的安装路径:

conda info | grep -i 'base environment'

参考链接:stackoverflow

posted @ 2024-04-13 12:40  何太狼  阅读(15)  评论(0编辑  收藏  举报