Anaconda: disable prompt change

Question:

When using anaconda (install for python), when I switch to the virtual env with this:

source activate my_env

It changes my prompt and adds (my_env) at the start of my PS1.

I’ve tried adding export VIRTUAL_ENV_DISABLE_PROMPT=1 to my bashrc, but it did not help.

Any idea?

Asked By: DevShark

||

Answers:

Answered By: Adam

Run this on the terminal:

$ conda config --set changeps1 False

http://conda.pydata.org/docs/config.html#change-command-prompt-changeps1

Answered By: rajats105

I’ve had a slightly different, but related problem: how to avoid the base env to be activated by default for every terminal window. Solution:

conda config --set auto_activate_base False

Note: this only works if you have run conda init first.

Answered By: saza

If you are like me, you like the non-default environment to show up if you have activated it, but don’t want to clutter up your prompt in other cases –
(e.g. you happen to use bash for reasons having nothing to do with python)

Place the following excerpt in your ~/.bash_profile right after the section managed by conda:

# ahj - remove the default Python environment artifact "(base)" from prompt
PS1=$(echo "$PS1" | perl -pe 's/^(base)s*//' )
Answered By: Charles Hebdough
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.