What is (base) in Mac Terminal Prompt and how to remove it?

What is (base) in Mac Terminal? How to remove it

What is (base) ?

    If you are wondering what the (base) prefix is before the zsh prompt and how did you end up getting it? Well you have it because Anaconda has been installed on your device and "base" is the default Python environment from conda.

    (base) c2ctech@MacBook-Pro ~ %

How to remove (base) from Mac Terminal?

    Removing (base) prefix is very simple, all you need to do is deactivate the default conda environment.

    conda deactivate

    If you want it back in the future, run the below command to activate the base environment back,

    conda activate base

    Note that this is not a permanent way to get the base environment disabled. You can do that by adding the deactivate command in the .zshrc profile file.

Disable (base) env using .zshrc file

    1. Open Terminal App,
    2. Open the .zshrc file,
      nano ~/.zshrc
    3. Now add the following line at the end.
      conda deactivate
    4. Reload the Zsh shell by either typing zsh or,
      source ~/.zshrc
    5. You will see that the base prefix is gone!

Have Questions? Post them here!