How to remove (base) from terminal prompt after updating conda

一世执手 提交于 2019-12-02 18:20:17

Use the base env's activation hook

For each env, any scripts in the etc/conda/activate.d directory will be executed post-activation (likewise etc/conda/deactivate.d scripts for deactivation). If you add a script to remove the (base), similar to @ewindes suggestion, you'll get the behavior you desire.

I had to create this directory for base, which is just the root of your Anaconda/Miniconda folder. E.g.,

mkdir -p miniconda3/etc/conda/activate.d

Then made a simple file in there (e.g., remove_base_ps1.sh) with one line:

PS1="$(echo $PS1 | sed 's/(base) //') "

Launching a new shell then does not show (base), and deactivating out of nested envs also takes care of the PS1 change.

You could add a command to your .bashrc to remove the "(base)" string from PS1:

PS1=$(echo $PS1 | sed 's/(base)//')

That's because conda's base environment is activated on startup.

To set the auto_activate_base parameter to false, type:

conda config --set auto_activate_base false

I'm a little bit late to the party, but following this answer, it was as easy as running this from my home directory:

echo "changeps1: False" >> .condarc
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!