Command referenceconda env remove
conda env remove command (Linux & Windows / Conda)
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 / option | Meaning |
|---|---|
| -n, --name | Name of the environment to delete. |
| -p, --prefix | Prefix path of the environment to delete. |
| -y, --yes | Do not ask for confirmation. |
| --all | Used 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.
Related commands
- conda env listList all Conda environments and mark the currently active one.
- conda removeUninstall one or more packages from a Conda environment (or remove an entire env with --all).
- conda cleanRemove unused Conda cache files, package tarballs, and temporary indices to free disk space.
- conda createCreate a new isolated Conda environment with an optional Python version and starter packages.
- conda activateActivate a named or path-based Conda environment in the current shell session.
- 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.
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.