在ubuntu上安装了Anaconda之后,每次启动终端就会自动进入conda的base环境,可以通过如下指令退出conda环境:
conda deactivate
但是考虑到每次都需要执行这一步才能退出,比较麻烦,因此想要启动终端后不进入conda环境。网上推荐通过修改conda的config文件来实现:
conda config --set auto_activate_base false
但是,我这里并没有用,启动之后还是会自动进入conda的base环境。最后的解决方案是,直接修改conda的配置文件来实现:
sudo vi ~/.condarc
在最后一行补充:
auto_activate_base: false
至此,完成。
通过“conda -h”查询具体的设置:
usage: conda [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.
Options:
positional arguments:
command
clean Remove unused packages and caches.
config Modify configuration values in .condarc. This is modeled
after the git config command. Writes to the user .condarc
file (/home/XXX/.condarc)