禁止Conda默认进入base环境
问题介绍
安装anaconda后取消命令行前出现的base,取消每次启动自动激活conda的基础环境。
造成原因
conda默认设置。
解决方案
- 方法一:
- 每次通过进入命令行后通过
conda deactivate退出base环境回到系统自动的环境
- 每次通过进入命令行后通过
- 方法二
- 希望在启动时不激活
conda的base环境,通过将auto_activate_base参数设置为false,conda config --set auto_activate_base false - 那要进入的话通过
conda activate base - 如果反悔了,还是希望
base一直留着,通过conda config --set auto_activate_base true来恢复
- 希望在启动时不激活
文档建议
有一种更合适的方法,就是直接取消conda默认的显示环境的设置,如下所述:
To simply return to the
baseenvironment, it’s better to callconda activatewith no environment specified, rather than to try to deactivate. If you runconda deactivatefrom yourbaseenvironment, you may lose the ability to run conda at all. Don’t worry, that’s local to this shell - you can start a new one. By default, the command prompt is set to show the name of the active environment. To disable this option:
conda config --set changeps1 false
To re-enable this option:
conda config --set changeps1 true
