Overview
Theconda 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
Target Environment Specification
Name of environment.
Full path to environment location (i.e. prefix).
Package Specifications
Package names to remove from the environment. Can be multiple packages separated by spaces.
Remove all packages, i.e., the entire environment.
Used with
--all, delete all packages but keep the environment.Solver Mode Modifiers
Remove features (instead of packages).
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.
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.Choose which solver backend to use.
Channel Customization
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 locally built packages. Identical to
-c local.Do not search default or .condarc channels. Requires —channel.
Specify file name of repodata on the remote server. Can be passed multiple times.
Enable experimental features. Options:
jlap (download incremental package index data), lock (use locking when reading/updating index cache).Disable locking when reading, updating index (repodata.json) cache.
Check for/do not check for repodata.json.zst. Enabled by default.
Networking Options
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.
Allow conda to perform “insecure” SSL connections and transfers. Equivalent to setting
ssl_verify to false.Offline mode. Don’t connect to the Internet.
Output, Prompt, and Flow Control Options
Report all output as json. Suitable for using conda programmatically.
Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG logging, four times for TRACE logging.
Do not display progress bar.
Only display what would have been done.
Sets any confirmation values to ‘yes’ automatically. Users will not be asked to confirm any adding, deleting, backups, etc.
Environment Protection
DANGEROUS. Use at your own risk. Ignore protections if the environment is frozen.
Examples
Common Use Cases
Removing a Single Package
Remove a package from the current environment:Removing Multiple Packages
Remove several packages at once:Removing from a Specific Environment
Remove packages from a named environment:Removing an Entire Environment
Delete all packages and the environment itself:Clearing an Environment
Remove all packages but keep the environment structure:Force Removing a Package
Remove a package without checking dependencies (use with caution):Previewing Package Removal
See what would be removed without actually removing: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.