Anaconda
Python
Environment
Configuration
Guide

How to change default Anaconda python environment

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

When people say "change the default Anaconda environment," they usually mean one of two things: stop base from auto-activating when a shell opens, or make a different environment the one Conda activates by default. Modern conda supports both behaviors through configuration settings instead of shell hacks alone.

Understand the Default Behavior

After conda init, many shells start by auto-activating the base environment. Current conda configuration exposes this through settings such as:

  • 'auto_activate with alias auto_activate_base'
  • 'default_activation_env'

So the first question is whether you want:

  • no environment activated automatically
  • a different named environment activated automatically

Those are different configurations.

Disable Automatic Activation of base

If your goal is simply to stop landing in base every time you open a terminal:

bash
conda config --set auto_activate_base false

After restarting the shell, Conda will be initialized but it will not automatically activate base.

You can still activate an environment manually:

bash
conda activate myenv

This is a common setup for developers who want cleaner shells and explicit environment control.

Set a Different Default Activation Environment

If you want Conda to auto-activate a different environment instead of base, set the default activation environment:

bash
conda config --set default_activation_env myenv
conda config --set auto_activate true

Now, when a new shell starts, Conda will try to activate myenv automatically. This is the current configuration-based way to make another environment your startup default.

Inspect the Current Configuration

You can check what Conda thinks the relevant settings are:

bash
conda config --show auto_activate
conda config --show default_activation_env

Or inspect the full configuration:

bash
conda config --show

That is helpful when behavior does not match what you expected.

Another Meaning of "Default"

Some users mean "which environment gets activated when I type conda activate with no arguments." Current Conda documentation ties that behavior to default_activation_env as well. So the same setting affects both startup activation, when auto_activate is enabled, and the no-argument default activation target.

That is why this configuration knob is more useful than editing shell startup scripts by hand.

Keep Shell Startup Files Simple

Older advice often suggested manually editing .bashrc, .zshrc, or similar shell files to activate a specific environment on startup. That still works, but it is less clean than using conda config because it mixes Conda policy with shell-specific custom code.

If Conda can manage the behavior directly, prefer the built-in configuration settings first.

Common Pitfalls

The biggest pitfall is confusing "disable automatic activation" with "change the default environment." Turning off auto_activate_base does not by itself make another environment the default.

Another common issue is forgetting to restart the shell after changing configuration. The old session may still reflect the previous activation state.

People also edit shell startup files manually and then forget about those changes later, which makes Conda behavior harder to debug.

Another subtle issue is changing the Conda config but testing in an already-open shell that still reflects the previous activation state.

Summary

  • Use conda config --set auto_activate_base false to stop base from auto-activating.
  • Use conda config --set default_activation_env myenv to point Conda at a different default environment.
  • Enable auto_activate if you want that environment activated automatically when a shell starts.
  • Check settings with conda config --show when behavior is unclear.
  • Prefer Conda's own configuration over ad hoc shell-script activation hacks.
  • Restart the shell after changes so you are testing the new activation behavior, not the old session.

Course illustration
Course illustration

All Rights Reserved.