After installing Anaconda on your macOS system, the base
environment is automatically activated each time you open a Terminal window. To disable this behavior, follow these steps:
-
Open the Terminal
After installing Anaconda, launch a Terminal window or Anaconda Navigator. -
Check the
.zshrc
Configuration File
In the Terminal, run the following command to check if Conda's initialization script is present in your.zshrc
file:$ nano ~/.zshrc
Look for the Conda initialization block, which typically appears as:
# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then . "/opt/anaconda3/etc/profile.d/conda.sh" else export PATH="/opt/anaconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<<
-
Disable Auto-Activation of the
base
Environment
To prevent thebase
environment from automatically activating, execute the following command in the Terminal:$ conda config --set auto_activate_base false
-
Verify the Configuration
You can confirm that the setting has been applied by checking the~/.condarc
file. A new line should have been added:channels: - defaults - https://repo.anaconda.com/pkgs/main - https://repo.anaconda.com/pkgs/r ssl_verify: true auto_activate_base: false
By following these steps, the base
environment will no longer activate automatically whenever you open a new Terminal window.