解决conda activate报错IMPORTANT: You may need to close and restart your shell after running ‘conda init‘

完整报错是:

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

解决方法

在控制台运行:

source activate
conda deactivate

问题解析

未正确退出环境,会导致这样的报错。如果按照它说的先退出并重启shell,再执行conda init并没有什么卵用…

你可能感兴趣的:(运维,linux)