conda remove#

Remove a list of packages from a specified conda environment.

Use --all flag to remove all packages and the environment itself.

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. If you wish to skip this dependency checking and remove just the requested packages, add the '--force' option. Note however that this may result in a broken environment, so use this with caution.

usage: conda remove [-h] [-n ENVIRONMENT | -p PATH] [-c CHANNEL] [--use-local]
                    [--override-channels] [--repodata-fn REPODATA_FNS]
                    [--experimental {jlap,lock}] [--no-lock]
                    [--repodata-use-zst | --no-repodata-use-zst] [--features]
                    [--force-remove] [--no-pin] [--solver {classic}] [-C] [-k]
                    [--offline] [--json] [-v] [-q] [-d] [-y] [--all]
                    [--keep-env] [--dev]
                    [package_name ...]

Positional Arguments#

package_name

Package names to remove from the environment.

Named Arguments#

--all

Remove all packages, i.e., the entire environment.

--keep-env

Used with --all, delete all packages but keep the environment.

--dev

Use sys.executable -m conda in wrapper scripts instead of CONDA_EXE. This is mainly for use during tests where we test new conda sources against old Python versions.

Target Environment Specification#

-n, --name

Name of environment.

-p, --prefix

Full path to environment location (i.e. prefix).

Channel Customization#

-c, --channel

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'). Then, the defaults or channels from .condarc are searched (unless --override-channels is given). You can use 'defaults' to get the default packages for conda. You can also use any name and the .condarc channel_alias value will be prepended. The default channel_alias is https://conda.anaconda.org/.

--use-local

Use locally built packages. Identical to '-c local'.

--override-channels

Do not search default or .condarc channels. Requires --channel.

--repodata-fn

Specify file name of repodata on the remote server where your channels are configured or within local backups. Conda will try whatever you specify, but will ultimately fall back to repodata.json if your specs are not satisfiable with what you specify here. This is used to employ repodata that is smaller and reduced in time scope. You may pass this flag more than once. Leftmost entries are tried first, and the fallback to repodata.json is added for you automatically. For more information, see conda config --describe repodata_fns.

--experimental

Possible choices: jlap, lock

jlap: Download incremental package index data from repodata.jlap; implies 'lock'. lock: use locking when reading, updating index (repodata.json) cache. Now enabled.

--no-lock

Disable locking when reading, updating index (repodata.json) cache.

--repodata-use-zst, --no-repodata-use-zst

Check for/do not check for repodata.json.zst. Enabled by default. (default: Null)

Solver Mode Modifiers#

--features

Remove features (instead of packages).

--force-remove, --force

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

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

Possible choices: classic

Choose which solver backend to use.

Networking Options#

-C, --use-index-cache

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, which will save bandwidth.

-k, --insecure

Allow conda to perform "insecure" SSL connections and transfers. Equivalent to setting 'ssl_verify' to 'false'.

--offline

Offline mode. Don't connect to the Internet.

Output, Prompt, and Flow Control Options#

--json

Report all output as json. Suitable for using conda programmatically.

-v, --verbose

Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG logging, four times for TRACE logging.

-q, --quiet

Do not display progress bar.

-d, --dry-run

Only display what would have been done.

-y, --yes

Sets any confirmation values to 'yes' automatically. Users will not be asked to confirm any adding, deleting, backups, etc.

Examples:

Remove the package 'scipy' from the currently-active environment:

conda remove scipy

Remove a list of packages from an environment 'myenv':

conda remove -n myenv scipy curl wheel

Remove all packages from environment myenv and the environment itself:

conda remove -n myenv --all

Remove all packages from the environment myenv but retain the environment:

conda remove -n myenv --all --keep-env