LinuxCommandLibrary

conda-list

List installed Conda packages

TLDR

List all packages in the current environment

$ conda list
copy

List packages in the named environment
$ conda list [[-n|--name]] [environment]
copy

List packages installed in a given path
$ conda list [[-p|--prefix]] [path/to/environment]
copy

Filter installed packages using regex
$ conda list [regex]
copy

Save packages for future use
$ conda list [[-e|--export]] > [path/to/package-list.txt]
copy

SYNOPSIS

conda list [-n ENV_NAME | -p ENV_PATH] [package_spec] [options]

PARAMETERS

-n ENV_NAME, --name ENV_NAME
    List packages in the specified environment by name. For example, 'conda list -n my_env'.

-p ENV_PATH, --prefix ENV_PATH
    List packages in the specified environment by its absolute path. Useful when environments are not in the default locations.

-r, --revisions
    List the revision history for the active environment. This shows when changes were made and what packages were affected.

--json
    Output all requested information in JSON format, facilitating programmatic parsing and integration with other tools.

--show-channel-urls
    Show the full channel URL for each package. This is often the default behavior in newer Conda versions.

-f REGEX, --filter REGEX
    Filter the list of packages by a regular expression pattern. Only packages matching the pattern will be displayed.

-e, --export
    Output the packages in a format suitable for recreating an environment. Note: conda env export is generally preferred for full environment definitions.

--explicit
    List all explicitly installed packages, excluding their dependencies.

--full-name
    Display the full package name, including the version and build string, without truncation.

--md5
    Show the MD5 hash of each package file, providing a checksum for verification.

--no-pip
    Do not include pip-installed packages in the output list.

DESCRIPTION

The conda list command is a fundamental tool for inspecting the contents of Conda environments. It displays a comprehensive list of all packages installed within a specified (or currently active) environment, along with their respective versions, build strings, and the channels from which they were installed. This command is invaluable for verifying installed dependencies, debugging environment issues, and preparing to reproduce environments. Users can specify an environment by name or path, filter results by package name, and even view the history of changes made to an environment through its revision system. It serves as a quick overview of an environment's current state, aiding in both development and deployment workflows.

CAVEATS

The --export option for conda list provides a simpler list of packages than conda env export, which is generally recommended for generating complete, reproducible environment definition files (environment.yml). Output can be extensive for large environments. When using package_spec, remember it filters by name, not by exact match.

DEFAULT BEHAVIOR

When no environment is specified using -n or -p, conda list operates on the currently active Conda environment. If no package_spec is provided, it lists all installed packages in that environment.

SEARCHING FOR PACKAGES

You can provide a package_spec argument (e.g., 'numpy' or 'python=3.9') directly after the command name to search for specific packages within an environment. This acts as a simple filter.

HISTORY

Part of the core Conda package manager from its early development by Continuum Analytics (now Anaconda Inc.), conda list has been a foundational command for environment inspection since its inception, evolving with Conda's features for package and environment management.

SEE ALSO

conda install(1), conda remove(1), conda create(1), conda env export(1), pip freeze(1)

Copied to clipboard