取消ubuntu终端启动后自动进入conda的base环境

在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) by default.
    create       Create a new conda environment from a list of specified
                 packages.
    help         Displays a list of available conda commands and their help
                 strings.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction. [Experimental]
    install      Installs a list of packages into a specified conda
                 environment.
    list         List linked packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove.
    run          Run an executable in a conda environment. [Experimental]
    search       Search for packages and display associated information. The
                 input is a MatchSpec, a query language for conda packages.
                 See examples below.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

 

你可能感兴趣的:(解决方案,Ubuntu,指南,ubuntu,anaconda)