The following packages are not available from current channels

avatar
Borislav Hadzhiev

Last updated: Apr 11, 2024
3 min

banner

# The following packages are not available from current channels

The Conda "PackagesNotFoundError: The following packages are not available from current channels" occurs when some of the packages you're trying to install are not available in your current Conda channels.

To solve the error, add the conda-forge channel by issuing the conda config command.

Here is the complete error message:

shell
Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.PackagesNotFoundError: The following packages are not available from current channels: To search for alternate channels that may provide the conda package you're looking for, navigate tohttps://anaconda.organd use the search bar at the top of the page.

Open your terminal and run the following command.

shell
conda config --append channels conda-forge

add conda forge to channels

The conda config --append command adds the specified channel to the bottom of the channel list and makes it the lowest priority.

The next time you run the conda install command, conda will also look for the given package in the conda-forge channel.

shell
conda install requests

conda install package success

Conda channels are servers that store packages.

These servers host and manage packages.

When you conda install a package, it gets downloaded from a remote channel.

Some of the channels might not store the packages you're trying to install.

It should also be noted that different channels can have the same package, so Conda needs to handle channel collisions.

If the error persists, you can try to install the package using pip.

shell
pip install requests # Or with pip3 pip3 install requests

You can use the conda list command to list the installed packages in your conda environment.

shell
conda list

The command will show the names of the packages and the installed version.

# Try restoring the free Conda channels

If the error persists, try to restore the free Conda channels.

Open your terminal and issue the following command.

shell
conda config --set restore_free_channel true

restore free conda channels

After you run the command, try to rerun your conda install command.

shell
conda install requests

conda install package success

# Explicitly setting the channel

The conda config --append command can be used to append a channel to your list of channels.

shell
conda config --append channels conda-forge

However, you can also explicitly set the channel when installing a module.

shell
conda install -c conda-forge requests

Make sure to replace requests with the name of the package you're trying to install.

You can also try to specify multiple channels.

shell
conda install requests -c defaults -c conda-forge -c pytorch

The command installs the requests module using the defaults, conda-forge or pytorch channels.

# Installing a requirements.txt file with multiple channels

If you got the error when trying to install the packages from your requirements.txt file, run the following command.

shell
conda install -y --file requirements.txt -c defaults -c conda-forge -c pytorch

You can add as many channels as necessary by using the -c parameter.

# Try using the pip install command instead

If the error persists, try to use the pip install command.

shell
pip install requests # Or with pip3 pip3 install requests

When installing a module in a Jupyter Notebook cell, prefix the command with an exclamation mark.

# Try adding the package you are trying to install as a channel

If the error persists, try to add the package you are trying to install as a channel.

For example, if you were trying to install keras, you would run the following command.

shell
conda config — append channels keras

Then run the installation command.

shell
conda install keras

# Try to update Anaconda

If the error persists, try to update Anaconda.

The following command updates all packages in the current environment to the latest version.

shell
conda update --all

Try to rerun your installation command after updating Anaconda.

shell
conda install requests

conda install package success

You can also try to run the following command.

shell
conda update conda

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.