Last updated: Apr 10, 2024
Reading time·5 min
To solve the error "subprocess-exited-with-error: This error originates from a subprocess, and is likely not a problem with pip":
pip
, setuptools
and wheel
.note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for X ERROR: Could not build wheels for X, which is required to install pyproject.toml-based projects [end of output] error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.
pip
, setuptools
and wheel
The first thing you should try is to upgrade your versions of pip, setuptools and wheel.
pip install wheel setuptools pip --upgrade pip3 install wheel setuptools pip --upgrade # 👇️ If you don't have pip in your PATH environment variable python -m pip install wheel setuptools pip --upgrade python3 -m pip install wheel setuptools pip --upgrade py -m pip install wheel setuptools pip --upgrade
pip install
command after you have upgraded pip
, setuptools
and wheel
.pip
to 21.3.1
If the error is not resolved, try to downgrade your version of pip
to 21.3.1
before running pip install
.
pip install pip==21.3.1 pip3 install pip==21.3.1 python -m pip install pip==21.3.1 python3 -m pip install pip==21.3.1 py -m pip install pip==21.3.1
--use-deprecated-legacy
option when installing the packageIf that didn't help, try running the pip install
command with the
--use-deprecated-legacy
option.
pip install numpy --use-deprecated=legacy-resolver pip3 install numpy --use-deprecated=legacy-resolver python -m pip install numpy --use-deprecated=legacy-resolver python3 -m pip install numpy --use-deprecated=legacy-resolver py -m pip install numpy --use-deprecated=legacy-resolver # -------------------------------------------------------------- # 👇️ Set to backtrack-on-build-failures for older versions of pip pip install numpy --use-deprecated=backtrack-on-build-failures pip3 install numpy --use-deprecated=backtrack-on-build-failures python -m pip install numpy --use-deprecated=backtrack-on-build-failures python3 -m pip install numpy --use-deprecated=backtrack-on-build-failures
numpy
with the name of the package you're trying to install.The --use-deprecated
option allows us to use the old resolver behavior when
installing modules.
If the suggestions didn't help, read toward the end of your error message.
It might contain information such as: "RuntimeError: Cannot install on Python version 3.11.0; only versions >=3.7,<3.11 are supported."
In this case, you have to use a Python version that is supported by the package.
Your error message might also contain a missing package you have to install, e.g. ModuleNotFoundError: No module named 'X' or ImportError: cannot import name 'X'.
If that's the case, you have to pip install
the package from the error message
before installing the other package.
pip install <package_from_error_message> pip3 install <package_from_error_message>
Another common cause of the error is misspelling the name of the package and trying to install some broken, obsolete module by mistake.
If you are on Windows, make sure you have the Microsoft build tools installed.
Your error message might contain information such as "error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/".
Download the Microsoft Build tools and check the "Desktop development with C++ checkbox when installing.
The error "note: This error originates from a subprocess, and is likely not a problem with pip" is sometimes caused when the package you are trying to install doesn't have available wheels for your version of Python.
You can check your Python version with the python --version
command.
python --version
You can check if a package has wheels available for a specific Python version in
the Download files section of the
package's pypi
page.
cp310
in the name of a file under "Built Distributions" means Python version 3.10 is supported for the specific operating system.If the .whl
files are not available for your version of Python, you can
download an older version.
--pre
optionThe first thing you should try though is to run 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
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 didn't work, 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.
Make sure to tick the following options if you get prompted:
If that didn't help and you don't already have a virtual environment, try creating one.
To solve the "note: This error originates from a subprocess, and is likely not a problem with pip" error:
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
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.
You might have multiple Python versions installed.
You can check your Python version with the python --version
command.
python --version python3 --version
For example, my Python version is 3.10.4
, so I would install the package with
pip3.10 install package-name
.
pip3.10 install package-name
Notice that the version number corresponds to the version of pip
I'm using.
Make sure to replace package-name
with the actual name of the package you're
trying to install.
If you have issues with your pip installation, check out my other article on how to properly install and upgrade pip on all operating systems.
If none of the suggestions helped, try running the pip install
command in
verbose mode.
pip install requests -vvv pip3 install requests -vvv python -m pip install requests -vvv
The -v
option stands for verbose mode and can be used up to 3 times.
When the pip install
command is run in verbose mode, the command shows more
output and how the error occurred.
You can learn more about the related topics by checking out the following tutorials: