Skip to main content

Command referenceconda env remove

conda env remove command (Linux & Windows / Conda)

Linux & WindowsCondapackageintermediateDestructive — use carefully

What it does

Delete a Conda environment and all packages installed inside it. When people look up conda remove environment, 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.

Delete a Conda environment and all packages installed inside it.

Syntax

conda env remove [-n ENV | -p PATH] [-y]

Common options

Flag / optionMeaning
-n, --nameName of the environment to delete.
-p, --prefixPrefix path of the environment to delete.
-y, --yesDo not ask for confirmation.
--allUsed with `conda remove -n ENV --all` as an alternate form.

Practical examples

Delete by name

conda env remove -n old-ml

Removes the named environment after confirmation.

Non-interactive

conda env remove -n old-ml -y

Deletes without a prompt — use carefully in scripts.

Alternate form

conda remove -n old-ml --all

Same outcome via conda remove with --all.

Prefix env

conda env remove -p ./envs/demo

Deletes a path-based environment.

Common mistakes

  • Removing an environment while it is still active in the same shell.
  • Typing `conda remove numpy` when you meant to delete the whole environment — that only uninstalls a package.

FAQ

What does conda env remove do in Conda?

Delete a Conda environment and all packages installed inside it.

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

Try `conda env remove -n old-ml` — Removes the named environment after confirmation.

Is mamba the same as conda env remove?

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.