Last updated: Apr 9, 2024
Reading timeยท5 min
To solve the "ERROR: pip's dependency resolver does not currently take into account all the packages that are installed":
wheel
, setuptools
and pip
.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.
wheel
packageThe first thing you should try is to install wheel.
Run the following command to install wheel
.
pip install wheel pip3 install wheel python -m pip install wheel python3 -m pip install wheel # ๐๏ธ For Windows py -m pip install wheel
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.
# ๐๏ธ 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.
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
h5py
and typing-extensions
modulesIf the error is not resolved, try installing h5py and typing-extensions before installing wheel.
pip install h5py pip install typing-extensions pip install wheel pip3 install h5py pip3 install typing-extensions pip3 install wheel
If the error persists, use the pip show package_name
command to check if the
package is actually installed.
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.
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.
# ๐๏ธ 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.
pip install requests==2.28.0 pip3 install requests==2.28.0
If the error persists, create a virtual environment or uninstall the package and install it again.
pip install
command with the virtual environment active.# ๐๏ธ 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
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.
# ๐๏ธ 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
.
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
.
The screenshot shows that the package supports Python 3.7+.
If the package doesn't support the latest version of Python, try running the
pip install
command with the --pre
option.
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
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:
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.
To solve the "ERROR: pip's dependency resolver does not currently take into account all the packages that are installed":
wheel
, setuptools
and pip
.