在linux系统中,安装了anaconda,配置了conda环境变量,也使用conda命令创建了新的环境my_env,但在使用conda激活时,报错。
报错问题
输入:
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’.
解决方法
在终端执行以下两条命令:
source activate
source deactivate