Why does “(base)” appear in front of my terminal prompt II?

10,129

I had the same issue this morning and did some sleuthing. I updated conda last night, and when I ran the initialization script, it added similar code to my .bash_profile file. The code runs the script generated by conda shell.bash hook. The last line of this script is conda activate base, which adds (base) to the beginning of your prompt (and modifies some environment variables like your path). You can override this by adding the following command to your .condarc file.

auto_activate_base: false

One possible issue with not auto-activating the base environment is the conda initialization script does not add your base/bin directory to your path if you do not activate the base environment. I already add it to my path in my .bash_profile, so it is not an issue for me.

Share:
10,129

Related videos on Youtube

Pablo Ruiz
Author by

Pablo Ruiz

Updated on September 18, 2022

Comments

  • Pablo Ruiz
    Pablo Ruiz over 1 year

    I have conda with two environments working, I have installed "conda_nb" and since I did it, the word "(base)" appears always in my prompt, I discovered that I can remove for a session using conda deactivate.

    enter image description here

    I found a similar question but it is not exactly the same problem since I've tried all the possible solutions from there, but none of those worked for me. Therefore the origin of this problem is not exactly the same.

    Deleting conda_nb didn't work for me, nor change lines of .bashrc that I post here:

    # added by Anaconda3 2018.12 installer
    # >>> conda init >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$(CONDA_REPORT_ERRORS=false '/home/pablo/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
    if [ $? -eq 0 ]; then
        \eval "$__conda_setup"
    else
        if [ -f "/home/pablo/anaconda3/etc/profile.d/conda.sh" ]; then
            . "/home/pablo/anaconda3/etc/profile.d/conda.sh"
            CONDA_CHANGEPS1=false conda activate base
        else
            \export PATH="/home/pablo/anaconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda init <<<
    

    pd: in .profile there is no information about conda. und in anacnoda3/profile.d i didn't find nothing useful (but maybe there is).

    • Anglina
      Anglina almost 5 years
      This may help: conda.io/projects/conda/en/latest/user-guide/… I have just come across it, I had entered this previously: conda config --set change ps1 False I'm not even sure what I had done and wish I had come across the linked webpage sooner, hope this helps a few people!
    • John Mellor
      John Mellor almost 4 years
      There's no space in changeps1: conda config --set changeps1 False (but thanks for the tip!)
  • Pablo Ruiz
    Pablo Ruiz over 5 years
    Easy and effective, the problem is solved, many thanks!! :). Just to add that .condarc doesn't exist by default until you run "conda config" or create it in the /home directory
  • Black Jack 21
    Black Jack 21 about 5 years
    Can you please elaborate on how/what to do in .bash_profile? I am a noob and I have no idea what to do
  • Vicki B
    Vicki B over 4 years
    Red Floyd - look for the block of code added by conda. (see stackoverflow.com/questions/52721099/…). Copy/paste the "export path" line outside of that block (without the )
  • Mark Sprague
    Mark Sprague over 4 years
    Red Floyd - the anaconda installer should have added some code to your .bash_profile file that begins __conda_setup=. This takes care of what you need to do to initialize Anaconda. If that line is not there, you can simply add eval "$(Path/to/anaconda/bin/conda bash hook)" to your .bash_profile. See docs.anaconda.com/anaconda/install/silent-mode.
  • Mark Sprague
    Mark Sprague over 4 years
    Correction: My previous response and the web page are no longer correct. The correct line in your .bash_profile should be eval "$(Path/to/anaconda/bin/conda shell.bash hook)".