Skip to main content

Command referenceconda deactivate

conda deactivate command (Linux & Windows / Conda)

Linux & WindowsCondapackagebeginner

What it does

Leave the current Conda environment and restore the previous shell PATH stack. When people look up conda deactivate, 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.

Leave the current Conda environment and restore the previous shell PATH stack.

Syntax

conda deactivate

Common options

Flag / optionMeaning
(no flags)Pops one activation level from the shell stack.

Practical examples

Leave the env

conda deactivate

Removes the active env's bin/Scripts directory from PATH.

Nested activations

conda deactivate && conda deactivate

Needed if you activated multiple environments in sequence.

Verify

conda deactivate && conda info --envs

Shows which environment (if any) remains active.

Common mistakes

  • Expecting deactivate to delete the environment — it only changes the shell session.
  • Using `deactivate` without Conda initialized in that shell.

FAQ

What does conda deactivate do in Conda?

Leave the current Conda environment and restore the previous shell PATH stack.

Does conda deactivate 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 deactivate example?

Try `conda deactivate` — Removes the active env's bin/Scripts directory from PATH.

Is mamba the same as conda deactivate?

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.