Skip to main content

Overview

The conda remove command removes a list of packages from a specified conda environment. This command will also remove any package that depends on any of the specified packages as well, unless a replacement can be found without that dependency. Use the --all flag to remove all packages and the environment itself.

Syntax

conda remove [options] [package_name ...]

Target Environment Specification

-n, --name
string
Name of environment.
-p, --prefix
string
Full path to environment location (i.e. prefix).

Package Specifications

package_name
string
Package names to remove from the environment. Can be multiple packages separated by spaces.
--all
boolean
Remove all packages, i.e., the entire environment.
--keep-env
boolean
Used with --all, delete all packages but keep the environment.

Solver Mode Modifiers

--features
boolean
Remove features (instead of packages).
--force-remove, --force
boolean
Forces removal of a package without removing packages that depend on it. Using this option will usually leave your environment in a broken and inconsistent state.
--no-pin
boolean
Ignore pinned package(s) that apply to the current operation. These pinned packages might come from a .condarc file or a file in <TARGET_ENVIRONMENT>/conda-meta/pinned.
--solver
string
Choose which solver backend to use.

Channel Customization

-c, --channel
string
Additional channel to search for packages. These are URLs searched in the order they are given (including local directories using the file:// syntax or simply a path like /home/conda/mychan or ../mychan). Can be used multiple times.
--use-local
boolean
Use locally built packages. Identical to -c local.
-O, --override-channels
boolean
Do not search default or .condarc channels. Requires —channel.
--repodata-fn
string
Specify file name of repodata on the remote server. Can be passed multiple times.
--experimental
string
Enable experimental features. Options: jlap (download incremental package index data), lock (use locking when reading/updating index cache).
--no-lock
boolean
Disable locking when reading, updating index (repodata.json) cache.
--repodata-use-zst / --no-repodata-use-zst
boolean
Check for/do not check for repodata.json.zst. Enabled by default.

Networking Options

-C, --use-index-cache
boolean
Use cache of channel index files, even if it has expired. This is useful if you don’t want conda to check whether a new version of the repodata file exists.
-k, --insecure
boolean
Allow conda to perform “insecure” SSL connections and transfers. Equivalent to setting ssl_verify to false.
--offline
boolean
Offline mode. Don’t connect to the Internet.

Output, Prompt, and Flow Control Options

--json
boolean
Report all output as json. Suitable for using conda programmatically.
-v, --verbose
boolean
Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG logging, four times for TRACE logging.
-q, --quiet
boolean
Do not display progress bar.
-d, --dry-run
boolean
Only display what would have been done.
-y, --yes
boolean
Sets any confirmation values to ‘yes’ automatically. Users will not be asked to confirm any adding, deleting, backups, etc.

Environment Protection

--override-frozen
boolean
DANGEROUS. Use at your own risk. Ignore protections if the environment is frozen.

Examples

conda remove scipy

Common Use Cases

Removing a Single Package

Remove a package from the current environment:
conda remove scipy

Removing Multiple Packages

Remove several packages at once:
conda remove numpy pandas matplotlib scikit-learn

Removing from a Specific Environment

Remove packages from a named environment:
conda remove -n data-science jupyter notebook

Removing an Entire Environment

Delete all packages and the environment itself:
conda remove -n old-env --all

Clearing an Environment

Remove all packages but keep the environment structure:
conda remove -n myenv --all --keep-env

Force Removing a Package

Remove a package without checking dependencies (use with caution):
conda remove --force problematic-package

Previewing Package Removal

See what would be removed without actually removing:
conda remove --dry-run tensorflow
Using --force-remove or --force will usually leave your environment in a broken and inconsistent state. Use this option with extreme caution.
If you wish to skip dependency checking and remove just the requested packages, add the --force option. However, this may result in a broken environment, so use this with caution.
The conda remove command automatically removes dependent packages unless a suitable replacement can be found. This helps maintain environment consistency.

Build docs developers (and LLMs) love