Command referenceconda deactivate
conda deactivate command (Linux & Windows / Conda)
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 / option | Meaning |
|---|---|
| (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.
Related commands
- conda activateActivate a named or path-based Conda environment in the current shell session.
- conda env listList all Conda environments and mark the currently active one.
- conda initConfigure shell startup files so `conda activate` works in bash, zsh, PowerShell, cmd.exe, and others.
- conda createCreate a new isolated Conda environment with an optional Python version and starter packages.
- conda installInstall packages into the active or named Conda environment from configured channels.
- conda listList packages installed in the active or named Conda environment.
- aptSearch, install, update, and remove packages on Debian-based systems.
- conda env createCreate an environment from an environment.yml (or similar) specification file.
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.