Skip to main content

Conda Suggest

Project description

conda-suggest

Suggest packages to install to obtain command line utilities.

Quickstart

First, install conda-suggest via:

$ conda install -c conda-suggest

Then you can print a message for which packages to install to obtain a command via conda-suggest. For example, say we want to know where g++, the GNU C++ compiler comes from. We would then run something like the following.

$ conda suggest message g++
Command 'g++' not found in the environment, but can be installed with any of:

    $ conda install -c conda-forge cxx-compiler

The above assumes that the map files for the conda-forge channel have also been installed.

Python API

You may also use conda-suggest programatically. For example:

from conda_suggest.find import message, exact_find, substring_find

message("g++")
exact_find("python")
substring_find("xonsh")

Map files

Conda-suggest works by looking for "map files" on the system. Map files are simple text files where every line associates a command name with a package name separated by a colon, i.e. <command>:<package>\n. For example:

zfp:zfp
zic:tzcode
zima:pint-pulsar
zip:zip
zipcmp:libzip

These map files must be lexicographically sorted, first by the command, and then by the package. The map files are named according to the following scheme: <channel-name>.<subdir>.map. The message command (and others) will load and search all map files on $CONDA_SUGGEST_PATH. This environment variable will default to "~/.local/share/conda-suggest:<sys.exec_prefix>/share/conda-suggest" or it's platform-specific equivalent.

Users should install map files for all channels that they frequently use.

Generating the Map Files & the Cache Files

Creating the map files can be a tedious job because it requires searching through all artifacts on a channel. The conda suggest generate command automates this process for you. Currently this can look through a channel's artifacts in a local directory:

$ conda suggest generate /path/to/mirrors/channel-name

To make restarts safe and fast, the above command produces "cache files" with the naming scheme <channel-name>.<subdir>.cache.json. These are JSON files with the following layout:

{
  "<artifact-filename>": {
    "executables": ["cmd0", "cmd1", ...],
    "package": "<package-name>"
  },
  ...
}

In the cache file, the artifact name is the same as the artifact filename in the repodata.json for that channel & subdir combo. The package name is taken from the equivalent repodata entry.

Generating these cache files can take a very long time and they tend to be quite large. It is not recommended that you distribute these caches as part of any package. They are intended for local use only. The map files are the intended distibutable result.

At some point in the future, we would like to be able to generate maps based off of a remote repodata.json as well.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conda-suggest-0.1.1.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file conda-suggest-0.1.1.tar.gz.

File metadata

  • Download URL: conda-suggest-0.1.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for conda-suggest-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ed4408084dd33ed2ed046e1ff52e9877e26289d677d9036591a6e48cc6c77d5
MD5 3b36a632c3e6392ab04425ac696513c1
BLAKE2b-256 fbd5c8cf17195433102cd9c77b37eb7dde35184694a9cbb5457669e4771f4f18

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page