LinuxCommandLibrary

conda-search

Search for available Conda packages

TLDR

Search for a specific package

$ conda search [package_name]
copy

Search for a package along with its details
$ conda search [package_name] [[-i|--info]]
copy

Search for packages containing string in the package name
$ conda search "*string*"
copy

Search for specific version of the package
$ conda search "[package_name]>=[package_version]"
copy

Search a package within a specific channel
$ conda search [channel]::[package_name]
copy

Search if package is installed in any local environments
$ conda search --envs [package_name]
copy

SYNOPSIS

conda search [options] [package_name_regex]

PARAMETERS

package_name_regex
    A package name or regular expression to search for. If omitted, lists all packages from configured channels.

-h, --help
    Show this help message and exit.

-c CHANNEL, --channel CHANNEL
    Specify additional channels to search for packages. Can be used multiple times to add multiple channels.

--override-channels
    Do not use channels configured in .condarc. Use only channels provided with -c.

--platform PLATFORM
    Limit search to a specific platform (e.g., linux-64, osx-64, win-64).

--info
    Show all information about a package, not just name and version. Includes license, dependencies, and file details.

--full-name
    Only search for exact package names, not partial matches.

--offline
    Do not connect to the Internet. Only use packages found in the local cache.

--json
    Report all output as JSON. Suitable for programmatic use and parsing in scripts.

--reverse
    Reverse the sort order of the results, typically showing older versions first.

--all
    List all packages in configured channels, even if they conflict with an existing environment or are not directly installable.

DESCRIPTION

conda-search is a fundamental command within the Conda package manager, designed to efficiently discover available packages across various Conda channels. It enables users to search for software by package name, partial name, or specific version, querying both remote repositories and local caches. This command is indispensable for identifying software before installation, verifying package availability, and understanding different versions or builds available from configured channels. Its output typically includes the package name, version, build string, originating channel, and target platform, providing comprehensive details to aid package selection. It supports filtering by platform and channel, and can output results in a machine-readable JSON format for scripting purposes.

CAVEATS


• Searches can be slow if querying many remote channels without a warm local cache, as Conda needs to download repodata.
• The default output can be verbose; for scripting or precise filtering, use --json or pipe the output to tools like grep.
• Using --offline will only show packages that have previously been downloaded or indexed locally, not necessarily all available versions.
• Channel order and priority rules, configured in .condarc or specified via -c, significantly affect which package versions are found and listed.

<I>UNDERSTANDING CHANNELS</I>

Conda searches packages in a predefined list of channels (repositories). These are configured in the .condarc file or specified directly via the -c option. The order of channels can significantly impact which version of a package is found and ultimately installed, due to Conda's channel priority rules. Higher priority channels are checked first, and their packages can override those from lower priority channels.

<I>OUTPUT INTERPRETATION</I>

The default output of conda-search typically shows the package name, all available versions, a unique build string (e.g., py38_0, cuda112h2138a4d_0), and the channel it originates from. The build string often encodes important metadata, such as dependencies (like Python or CUDA version), specific compilation flags, or the compiler versions used to build the package, which helps in selecting the correct variant.

HISTORY

Conda, including its essential search capability, was developed by Continuum Analytics (now Anaconda, Inc.) and first released in 2012. It emerged as a powerful, cross-platform package and environment management system, initially focused on scientific computing with Python but quickly expanding to support packages from any language. conda-search has been a core component since its inception, critical for enabling users to discover and leverage the vast ecosystem of available software across diverse channels.

SEE ALSO

conda install(1), conda create(1), conda list(1), conda remove(1)

Copied to clipboard