Skip to main content

Command referenceconda activate

conda activate command (Linux & Windows / Conda)

Linux & WindowsCondapackagebeginner

What it does

Activate a named or path-based Conda environment in the current shell session. When people look up conda activate, they usually want safe flags, copyable examples, and how this Conda subcommand fits Anaconda or Miniconda workflows on Linux, Windows, and macOS. Syntax, options, and practical examples are below.

Activate a named or path-based Conda environment in the current shell session.

Syntax

conda activate [-n ENV | -p PATH | ENV]

Common options

Flag / optionMeaning
ENVEnvironment name or path to activate.
-n, --nameActivate by environment name.
-p, --prefixActivate by prefix path.
baseSwitch back to the base/root Conda environment.

Practical examples

Activate by name

conda activate ml

Puts the ml environment on PATH for the current shell.

Return to base

conda activate base

Switches back to the default Conda installation environment.

Activate by path

conda activate ./envs/demo

Activates a prefix-based environment without a registered name.

Check after activate

conda activate web && python -V

Confirms which Python the activated env exposes.

Common mistakes

  • Running `source activate` on modern Conda — use `conda activate` after `conda init`.
  • Calling activate inside a non-initialized shell (CI script) without `conda run` or `source "$(conda info --base)/etc/profile.d/conda.sh"`.
  • Assuming activation changes parent shells or IDE terminals automatically.

FAQ

What does conda activate do in Conda?

Activate a named or path-based Conda environment in the current shell session.

Does conda activate work on Windows and Linux?

Yes. Conda runs on Linux, Windows, and macOS; shell activation differs slightly after `conda init`, but the CLI flags are the same.

What is a practical conda activate example?

Try `conda activate ml` — Puts the ml environment on PATH for the current shell.

Is mamba the same as conda activate?

Mamba is a faster drop-in solver for many Conda workflows. Prefer `mamba` only when it is installed; otherwise use the Conda commands on this page.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.