conda install: Usage, Options & Common CI Errors
conda install adds packages (and non-Python deps) into a conda environment.
conda installs Python and native dependencies into isolated environments. Its CI reputation is for slow dependency solving and channel-related "not found" errors - both have known mitigations.
What it does
conda install resolves and installs packages from channels (defaults, conda-forge) into a named or active environment, handling native libraries that pip cannot. The classic solver is slow; the libmamba solver (default in recent conda) is much faster and recommended in CI.
Common usage
conda install -y numpy pandas
conda install -n myenv -c conda-forge -y scipy
conda install -y --solver=libmamba tensorflow
conda config --set channel_priority strict
conda clean -a -y # shrink the imageCommon errors in CI
"PackagesNotFoundError: The following packages are not available from current channels" means the package lives on a channel you have not added - add -c conda-forge. A job that appears to hang on "Solving environment:" is the slow classic solver; use --solver=libmamba and channel_priority strict. "CondaHTTPError: HTTP 000 CONNECTION FAILED" is a network/proxy issue against repo.anaconda.com. Always pass -y in CI, and pin versions for reproducibility.
Options
| Flag | What it does |
|---|---|
| -n <env> | Target a named environment |
| -c <channel> | Add a channel (e.g. conda-forge) |
| -y / --yes | Assume yes (required in CI) |
| --solver=libmamba | Use the fast solver |
| clean -a | Clear caches to shrink images |