LinuxCommandLibrary

conda-install

Install packages into conda environments

TLDR

Install one or more package into the currently active conda environment

$ conda install [package1 package2 ...]
copy

Install a single package into the currently active conda environment using channel conda-forge
$ conda install [[-c|--channel]] conda-forge [package]
copy

Install a single package into the currently active conda environment using channel conda-forge and ignoring other channels
$ conda install [[-c|--channel]] conda-forge --override-channels [package]
copy

Install a specific version of a package
$ conda install [package]=[version]
copy

Install a package into a specific environment
$ conda install [[-n|--name]] [environment] [package]
copy

Update a package in the current environment
$ conda install --upgrade [package]
copy

Install a package and agree to the transactions without prompting
$ conda install [[-y|--yes]] [package]
copy

SYNOPSIS

conda install [options] [package_name ...] | --file requirements.txt

PARAMETERS

-h, --help
    Show help message and exit

-n ENV, --name ENV
    Environment name to install into

-p PATH, --prefix PATH
    Full path to environment

-c CHANNEL, --channel CHANNEL
    Additional channel to search

--use-local
    Use locally built packages

--override-channels
    Ignore channel URLs from .condarc

--repodata-fn REPODATA_FNAME
    Specify repodata filename

--dry-run
    Simulate installation without changes

--revision REVISION
    Rollback to specific environment revision

-y, --yes
    Auto-confirm without prompts

--dev
    Use sys.executable for current interpreter

--no-deps
    Skip dependency resolution

--force-reinstall
    Reinstall even if up-to-date

--experimental-solver {classic,libmamba}
    Choose dependency solver

--no-channel-priority
    Ignore channel priority

--offline
    Offline mode, use cache only

-q, --quiet
    Minimal output

-v, --verbose
    Verbose output

DESCRIPTION

The conda install command installs packages and their dependencies into specified Conda environments. Conda is a cross-platform package and environment manager, primarily for Python but supporting any language. It resolves complex dependencies across libraries, binaries, and executables, ensuring reproducibility.

Usage involves specifying package names, optionally from channels like defaults or conda-forge. It creates or updates environments automatically, handling conflicts via a SAT solver (or faster libmamba in recent versions). For example, conda install numpy pandas fetches from channels, verifies hashes, and links files.

Key benefits include isolated environments (-n env_name), no-compile installs, and support for non-Python software like R or C++ libs. It's slower than pip for pure Python due to full dependency solving but more reliable for scientific stacks. Always run in activated environments or specify -n. Post-install, verify with conda list.

CAVEATS

Requires Conda installation (Anaconda/Miniconda); solver can be slow or fail on conflicts—use --experimental-solver libmamba; large environments grow disk usage; not for system-wide installs.

CHANNELS

Primary: defaults (Anaconda), conda-forge (community). Prioritize with conda config --add channels conda-forge.

ENVIRONMENTS

Create first with conda create -n myenv, activate via conda activate myenv.

VERIFICATION

Post-install: conda list or conda info.

HISTORY

Conda launched in 2012 by Continuum Analytics (now Anaconda). The install subcommand evolved from early prototypes, gaining SAT solver in 2016 (conda 4.0) for better dependency resolution. Libmamba solver added in 2022 (conda 22.9) for speed. Widely used in data science, with millions of downloads.

SEE ALSO

pip(1), apt-get(8), dnf(8), pacman(8)

Copied to clipboard