最近 CentOS7 下面使用 conda activate name 激活虚拟命令的时候,突然报错,信息如下:
CommandNotFoundError: 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'.
两种解决方案:
方法一
在终端输入命令
source activate
source deactivate
conda activate your_virtual_name
方法二
[root@linux01 kaka]# vim ~/.bashrc
# 在文件末尾加入
source ~/anaconda3/etc/profile.d/conda.sh
[root@linux01 kaka]# source ~/.bashrc
参考
https://blog.youkuaiyun.com/qq_33221533/article/details/100150534