A2oz

How to Install Python Packages Using Conda-Forge?

Published in Software Installation 2 mins read

Conda-forge is a popular channel for installing Python packages using the conda package manager. It offers a wide variety of packages, often with updated versions compared to the default conda channels.

Here's how to install Python packages using conda-forge:

  1. Enable the conda-forge channel:

    • Open your terminal or command prompt.

    • Run the following command:

      conda config --add channels conda-forge
  2. Install a package:

    • Use the conda install command followed by the package name:

      conda install <package_name>
    • Example: To install the numpy package:

      conda install numpy
  3. Specify a specific version:

    • If you need a particular version of the package, add = followed by the version number:

      conda install <package_name>=<version_number>
    • Example: To install numpy version 1.23.5:

      conda install numpy=1.23.5
  4. List available packages:

    • To see a list of packages available in conda-forge, use the conda search command:

      conda search -c conda-forge <package_name>
    • Example: To search for packages related to "pandas":

      conda search -c conda-forge pandas

Note: Conda-forge often provides packages that are not available in the default conda channels. By enabling conda-forge, you gain access to a broader selection of packages and their latest versions.

Related Articles