pip's dependency resolver does not currently take into account all the packages that are installed

avatar
Borislav Hadzhiev

Last updated: Apr 9, 2024
5 min

banner

# pip's dependency resolver does not currently take into account all the packages that are installed

To solve the "ERROR: pip's dependency resolver does not currently take into account all the packages that are installed":

  1. Install and upgrade wheel, setuptools and pip.
  2. Optionally create a virtual environment and install the package in it.
  3. Make sure your Python version is supported by the package.

error pips dependency resolved does not currently take

shell
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

# Install the wheel package

The first thing you should try is to install wheel.

Run the following command to install wheel.

shell
pip install wheel pip3 install wheel python -m pip install wheel python3 -m pip install wheel # ๐Ÿ‘‡๏ธ For Windows py -m pip install wheel

# Upgrade your version of pip

You should also upgrade your version of pip.

Here are the commands for upgrading pip on all operating systems.

Which command works depends on your operating system and your version of Python.

shell
# ๐Ÿ‘‡๏ธ If you have pip already installed pip install --upgrade pip # ๐Ÿ‘‡๏ธ If your pip is aliased as pip3 (Python 3) pip3 install --upgrade pip # ๐Ÿ‘‡๏ธ If you don't have pip in your PATH environment variable python -m pip install --upgrade pip # ๐Ÿ‘‡๏ธ If you don't have pip in your PATH environment variable python3 -m pip install --upgrade pip # ๐Ÿ‘‡๏ธ If you have easy_install easy_install --upgrade pip # ๐Ÿ‘‡๏ธ If you get a permissions error sudo easy_install --upgrade pip # ๐Ÿ‘‡๏ธ If you get a permissions error when upgrading `pip` pip install --upgrade pip --user # ๐Ÿ‘‡๏ธ Upgrade pip scoped to the current user (if you get a permissions error) python -m pip install --user --upgrade pip python3 -m pip install --user --upgrade pip # ๐Ÿ‘‡๏ธ Installing directly from get-pip.py (MacOS and Linux) curl https://bootstrap.pypa.io/get-pip.py | python # ๐Ÿ‘‡๏ธ If you get permissions issues curl https://bootstrap.pypa.io/get-pip.py | sudo python # ๐Ÿ‘‡๏ธ Alternative for Ubuntu/Debian sudo apt-get update && apt-get upgrade python-pip # ๐Ÿ‘‡๏ธ Alternative for Red Hat / CentOS / Fedora sudo yum install epel-release sudo yum install python-pip sudo yum update python-pip

After you upgrade pip, upgrade setuptools as well.

shell
pip install --upgrade setuptools pip3 install --upgrade setuptools python -m pip install --upgrade setuptools python3 -m pip install --upgrade setuptools py -m pip install --upgrade setuptools

# Install the h5py and typing-extensions modules

If the error is not resolved, try installing h5py and typing-extensions before installing wheel.

shell
pip install h5py pip install typing-extensions pip install wheel pip3 install h5py pip3 install typing-extensions pip3 install wheel

install h5py and typing extensions

If the error persists, use the pip show package_name command to check if the package is actually installed.

shell
pip show requests pip3 show requests python -m pip show requests python3 -m pip show requests

The pip show package_name command will either state that the package is not installed or show a bunch of information about the package.

The package might be installed even though the error is shown in your terminal.

# The error message might contain dependency conflicts

Your error message might contain one or more dependency conflicts, e.g. "seaborn 0.12.1 requires matplotlib!=3.6.1,>=3.1, but you have matplotlib 3.6.1 which is incompatible".

If this case, you can try uninstalling the seaborn package before installing matplotlib.

shell
# ๐Ÿ‘‡๏ธ Uninstall package that caused conflict pip uninstall seaborn pip3 uninstall seaborn python -m pip uninstall seaborn python3 -m pip uninstall seaborn # ๐Ÿ‘‡๏ธ Install both packages pip install matplotlib seaborn pip3 install matplotlib seaborn python -m pip install matplotlib seaborn python3 -m pip install matplotlib seaborn

Make sure to replace the packages with the ones from your error message.

An alternative would be to try to upgrade the seaborn package with the pip install seaborn --upgrade before installing matplotlib.

You can also install a version of the conflicting package that is in the specified by the error message range.

You can install a specific version of a package by separating the name of the package and the version with two equal signs.

shell
pip install requests==2.28.0 pip3 install requests==2.28.0

# Create a virtual environment

If the error persists, create a virtual environment or uninstall the package and install it again.

  1. Create a virtual environment.
  2. Activate the virtual environment.
  3. Run the pip install command with the virtual environment active.
shell
# ๐Ÿ‘‡๏ธ Use the correct version of Python when creating VENV python3 -m venv venv # ๐Ÿ‘‡๏ธ Activate on Unix or MacOS source venv/bin/activate # ๐Ÿ‘‡๏ธ Activate on Windows (cmd.exe) venv\Scripts\activate.bat # ๐Ÿ‘‡๏ธ Activate on Windows (PowerShell) venv\Scripts\Activate.ps1 # ๐Ÿ‘‡๏ธ Upgrade pip pip install --upgrade pip # ๐Ÿ‘‡๏ธ Install the specific package in the virtual environment pip install requests

If the python3 -m venv venv command doesn't work, try one of the following commands:

  • python -m venv venv
  • py -m venv venv
Make sure to use the correct command to activate your virtual environment depending on your operating system and your shell.

Your virtual environment will use the version of Python that was used to create it.

If that didn't help, try to uninstall the package and install it.

shell
# ๐Ÿ‘‡๏ธ Uninstall package pip uninstall requests pip3 uninstall requests python3 -m pip uninstall requests # ๐Ÿ‘‡๏ธ Install package pip install requests pip3 install requests python3 -m pip install requests

The error is often caused by having incompatible versions of dependencies, so creating an isolated virtual environment and installing the package should be sufficient to solve it.

If you still get the error, try to import the package in your code. Most likely the module is installed successfully even if the error message is shown when running pip install.

# Check if your Python version is supported by the package

Google for the name of the package and check if your Python version is supported by the package.

For example, if I google "requests pypi" and click on the pypi.org page, I can see the supported Python versions in the sidebar on the left, under Meta > Requires.

supported python versions by package

The screenshot shows that the package supports Python 3.7+.

If your Python version doesn't meet the requirements, the error "pip's dependency resolver does not currently take into account all the packages that are installed" occurs.

If the package doesn't support the latest version of Python, try running the pip install command with the --pre option.

shell
pip install requests --pre pip3 install requests --pre python -m pip install requests --pre python3 -m pip install requests --pre py -m pip install requests --pre
Make sure to replace requests with the name of the actual package you are trying to install.

The --pre option makes it so pip includes pre-release and development versions of the package. By default pip only finds stable versions.

If that doesn't work, you have to install a Python version that is in the specified range and then run the pip install <package_name> command.

You can upgrade your Python version by downloading the installer from the official python.org website and running it.

Make sure to tick the following options if you get prompted:

  • Install launcher for all users (recommended)
  • Add Python to PATH (this adds Python to your PATH environment variable)

You can download a specific Python version that is supported by the package if the package doesn't support the latest Python version.

Different versions are available in the "Looking for a specific release" table.

install specific python version

# Conclusion

To solve the "ERROR: pip's dependency resolver does not currently take into account all the packages that are installed":

  1. Install and upgrade wheel, setuptools and pip.
  2. Optionally create a virtual environment and install the package in it.
  3. Make sure your Python version is supported by the package.
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.

Copyright ยฉ 2024 Borislav Hadzhiev