Package Management Intermediate

Learn how to install, update, remove, and search for packages with Conda. Master version pinning, handle dependency conflicts, and understand when to use pip inside a Conda environment.

Installing Packages

Terminal
# Install a single package
$ conda install numpy

# Install multiple packages at once (recommended)
$ conda install numpy pandas scikit-learn matplotlib

# Install from conda-forge channel
$ conda install -c conda-forge polars

# Install into a specific (non-active) environment
$ conda install -n myenv numpy
Install multiple packages together: When possible, install all packages in a single command. This lets Conda's solver find compatible versions for everything at once, reducing the chance of conflicts later.

Specifying Versions

Terminal
# Exact version
$ conda install numpy=1.24.3

# Minimum version
$ conda install "numpy>=1.24"

# Version range
$ conda install "numpy>=1.24,<2.0"

# Latest 1.24.x (fuzzy match)
$ conda install numpy=1.24

# Multiple versioned packages
$ conda install numpy=1.24 pandas=2.0 python=3.11

Updating Packages

Terminal
# Update a specific package
$ conda update numpy

# Update all packages in the environment
$ conda update --all

# Update conda itself
$ conda update conda

Removing Packages

Terminal
# Remove a package
$ conda remove numpy

# Remove multiple packages
$ conda remove numpy pandas matplotlib

Listing Installed Packages

Terminal
# List all installed packages in active environment
$ conda list

# Search within installed packages
$ conda list numpy

# List packages in a specific environment
$ conda list -n myenv

# Show only packages installed via pip
$ conda list | grep pypi

Searching for Packages

Terminal
# Search for a package
$ conda search scikit-learn

# Search on conda-forge
$ conda search -c conda-forge polars

# See all available versions
$ conda search numpy --info

Using pip Inside Conda

Some packages are only available on PyPI, not in Conda channels. You can safely use pip inside a Conda environment, but follow these guidelines:

Terminal
# FIRST: Install everything available via conda
$ conda install numpy pandas scikit-learn

# THEN: Use pip for packages only on PyPI
$ pip install some-pypi-only-package

# IMPORTANT: Always use pip from the active conda env
# Verify pip is from the right environment:
$ which pip
/home/user/miniconda3/envs/myenv/bin/pip
Warning: After using pip in a Conda environment, avoid running conda install again if possible. Conda does not track pip-installed packages, so further conda installs might overwrite or conflict with pip packages. Install all conda packages first, then pip packages last.

Resolving Dependency Conflicts

When Conda reports conflicts, try these strategies:

  1. Install all packages together

    Instead of installing one at a time, list all packages in a single conda install or conda create command.

  2. Use conda-forge

    The conda-forge channel often has more recent and compatible versions: conda install -c conda-forge package_name

  3. Relax version constraints

    If you pinned an exact version, try allowing a range instead.

  4. Create a fresh environment

    Sometimes starting fresh is faster than fixing a tangled environment.

  5. Use Mamba

    Mamba's faster solver often resolves dependencies that Conda's solver times out on.

Quick Reference

Task Command
Install packageconda install numpy
Install specific versionconda install numpy=1.24
Update packageconda update numpy
Remove packageconda remove numpy
List installedconda list
Search packagesconda search numpy
Install from channelconda install -c conda-forge pkg

Next Up

Learn about Conda channels — where packages come from and how to configure them for your workflow.

Next: Channels →