Skip to main content

Command referenceconda deactivate (nested)

conda deactivate (nested) command (Linux & Windows / Conda)

Linux & WindowsCondapackagebeginner

What it does

Leave nested Conda activations until no Conda env remains active in the shell. When people look up conda deactivate nested, 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 nested Conda activations until no Conda env remains active in the shell.

Syntax

conda deactivate  # repeat until inactive

Common options

Flag / optionMeaning
(repeat)Each call pops one activation from the stack.

Practical examples

Pop one level

conda deactivate

Returns to the previously active env or an uninitialized PATH.

Clear nested envs

while [[ "$CONDA_SHLVL" -gt 0 ]]; do conda deactivate; done

Bash helper to leave every nested activation (Unix shells).

Check status

conda info --envs

Confirm no environment is marked active.

Common mistakes

  • Assuming one deactivate always returns to the system Python when base auto-activate is enabled.
  • Calling deactivate in a shell that never ran `conda init`.

FAQ

What does conda deactivate (nested) do in Conda?

Leave nested Conda activations until no Conda env remains active in the shell.

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

Try `conda deactivate` — Returns to the previously active env or an uninitialized PATH.

Is mamba the same as conda deactivate (nested)?

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.