Could not build wheels for X which use PEP 517 and cannot be installed directly

avatar
Borislav Hadzhiev

Last updated: Apr 9, 2024
15 min

banner

# Could not build wheels for X which use PEP 517 and cannot be installed directly

To solve the error "Could not build wheels for X which use PEP 517 and cannot be installed directly", run the pip install --upgrade pip command to upgrade your pip version and rerun the pip install <package-name> command.

shell
ERROR: Failed building wheel for <package-name> Failed to build pycairo ERROR: Could not build wheels for <package-name> which use PEP 517 and cannot be installed directly ERROR: Could not build wheels for <package-name>, which is required to install pyproject.toml-based projects

could-not-build-wheels-for-which-is-required-to-install-pyproject-toml

Another common name for the same error is: "ERROR: Could not build wheels for package-name, which is required to install pyproject.toml-based projects".

The solution for the two errors is the same.

The most common cause of the error is having an outdated version of pip.

# Upgrade your version of pip before installing the package

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

upgrade pip version

Now that pip is upgraded, try to run the pip install <package-name> command.

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

install module after upgrading

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

# Upgrade setuptools and wheel

If the error is not resolved, upgrade the setuptools and wheel packages as well.

shell
pip install --upgrade setuptools wheel pip3 install --upgrade setuptools wheel python3 -m pip install --upgrade setuptools wheel

upgrade setuptools and wheel

Try to rerun the pip install command after upgrading setuptools and wheel.

If that didn't help, try to run the pip install command with the --upgrade option.

shell
pip install requests --upgrade pip3 install requests --upgrade python -m pip install requests --upgrade python3 -m pip install requests --upgrade

use upgrade flag when installing

If the error is not resolved, try installing the package with the --no-cache-dir option to disable the cache.

shell
pip install requests --no-cache-dir pip3 install requests --no-cache-dir

install using no cache dir flag

If that didn't help, use the --pre option to include pre-release and development versions of the package.

shell
pip install requests --pre pip3 install requests --pre python -m pip install requests --pre python3 -m pip install requests --pre

install using pre flag

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

This sometimes helps because a pre-release version of the package might have a wheel available for your version of Python.

If the error is not resolved, try running the pip install command with the --no-use-pep517 option.

shell
pip install --no-use-pep517 requests pip3 install --no-use-pep517 requests python -m pip install --no-use-pep517 requests python3 -m pip install --no-use-pep517 requests

install using no use pep517 flag

If that didn't help, try installing another version of the package.

You can check the available versions of a package by running the pip install package== command.

shell
pip install requests==

pip list all available versions of package

The output contains a tuple of all of the versions of the package from the oldest to the most recent version.

Pick another version of the package and try installing it. Here is an example.

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

# Create a virtual environment

If that didn't help, try creating a virtual environment.

  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 the following 2 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.

# Try running pip install in verbose mode

If none of the suggestions helped, try running the pip install command in verbose mode.

shell
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.

# Check if your Python version is supported by the package

The error 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.

shell
python --version

get 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.

For example, 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.

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

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)

# Some packages have prerequisites

Some packages require you to have certain applications installed before you are able to pip install the package.

Here are some examples.

# Table of Contents

  1. Could not build wheels for python-ldap
  2. Could not build wheels for pyaudio
  3. Could not build wheels for pycocotools
  4. Could not build wheels for cx_Oracle
  5. Could not build wheels for scikit-learn
  6. Could not build wheels for opencv-python
  7. Could not build wheels for numpy
  8. Could not build wheels for cryptography
  9. Could not build wheels for psutil
  10. Could not build wheels for gevent
  11. Could not build wheels for pycairo
  12. Could not build wheels for pycuda
  13. Could not build wheels for tokenizers
  14. Could not build wheels for yarl, multidict
  15. Could not build wheels for xmlsec
  16. Could not build wheels for bcrypt
  17. Could not build wheels for hdbscan
  18. Could not build wheels for PyNaCl
  19. Could not build wheels for onnx
  20. Could not build wheels for spacy
  21. Could not build wheels for sip
  22. Could not build wheels for scipy

# ERROR: Could not build wheels for python-ldap in Python

The following error occurs when you install python-ldap without having the prerequisites installed.

shell
ERROR: Failed building wheel for python-ldap Failed to build python-ldap ERROR: Could not build wheels for python-ldap, which is required to install pyproject.toml-based projects

error could not build wheels for python ldap

Installing the prerequisites for python-ldap.

shell
# ๐Ÿ‘‡๏ธ Debian (Ubuntu) sudo apt-get install build-essential python3-dev \ libldap2-dev libsasl2-dev slapd ldap-utils tox \ lcov valgrind # ๐Ÿ‘‡๏ธ RedHat/CentOS yum groupinstall "Development tools" yum install openldap-devel python-devel # ๐Ÿ‘‡๏ธ Fedora dnf install "@C Development Tools and Libraries" openldap-devel \ python3-devel python3-tox \ lcov clang-analyzer valgrind # ๐Ÿ‘‡๏ธ Alpine apk add build-base openldap-dev python3-dev

You have to run the pip install python-ldap command after installing the prerequisites.

shell
pip install python-ldap pip3 install python-ldap

# ERROR: Could not build wheels for pyaudio in Python

The following error occurs when you install PyAudio without having the prerequisites installed.

shell
ERROR: Failed building wheel for pyaudio Failed to build pyaudio ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects

python error could not build wheels for pyaudio

First, if you are on Linux, make sure you have all the requirements of pyaudio.

shell
sudo apt install build-essential portaudio19-dev python3.10-dev pip install pyaudio
portaudio is a prerequisite of pyaudio, so if portaudio is missing, the error is raised.

If you are on macOS, try using brew to install the package.

shell
brew install portaudio brew link --overwrite portaudio pip install pyaudio

If you are on macOS, you also have to install portaudio before installing pyaudio.

You can read more about the prerequisite in the pypi page of pyaudio.

If you are on Windows, the python -m pip install pyaudio command installs the precompiled PyAudio library with PortAudio included.

If you use anaconda, try using conda.

shell
conda install -c anaconda pyaudio

After you have the prerequisites installed, run the installation command.

shell
pip install PyAudio pip3 install PyAudio

# ERROR: Could not build wheels for pycocotools in Python

The following error occurs when you install pycocotools without having the prerequisites installed.

shell
ERROR: Failed building wheel for pycocotools Failed to build pycocotools ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects

error could not build wheels for pycocotools

If you use anaconda, the first thing you should try is to run the following two commands.

shell
conda install -c conda-forge pycocotools conda install -c esri pycocotools

If you use Windows, install the pycocotools-windows package instead.

shell
pip install pycocotools-windows pip3 install pycocotools-windows python -m pip install pycocotools-windows python3 -m pip install pycocotools-windows

# Error: Could not build wheels for cx_Oracle in Python

The following error occurs when you install pycocotools without having the prerequisites installed.

shell
ERROR: Failed building wheel for cx_Oracle Failed to build cx_Oracle ERROR: Could not build wheels for cx_Oracle, which is required to install pyproject.toml-based projects

error could not build wheels for cx oracle

First, make sure to install gcc and python3-dev if you are on Linux.

shell
# ๐Ÿ‘‡๏ธ For Debian (Ubuntu) sudo apt-get install gcc python3-dev # ๐Ÿ‘‡๏ธ For RedHad / CentOS sudo yum install gcc python3-devel

After you install the prerequisites, run the following command to install cx-Oracle.

shell
pip install cx-Oracle --upgrade pip3 install cx-Oracle --upgrade

# ERROR: Could not build wheels for scikit-learn in Python

The following error occurs when installing scikit-learn.

shell
ERROR: Failed building wheel for scikit-learn Failed to build scikit-learn ERROR: Could not build wheels for scikit-learn, which is required to install pyproject.toml-based projects

If you use anaconda, try installing the package using conda.

shell
conda install -c anaconda scikit-learn conda install -c conda-forge scikit-learn pip install scikit-learn pip3 install scikit-learn

# Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

The following error occurs when installing opencv-python.

shell
ERROR: Failed building wheel for opencv-python Failed to build opencv-python ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

After you update your version of pip, run the following command.

shell
pip install opencv-python pip3 install opencv-python python -m pip install opencv-python python3 -m pip install opencv-python # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge opencv # ๐Ÿ‘‡๏ธ Alternative for Debian (Ubuntu) sudo apt-get install python-opencv

# Error: Could not build wheels for numpy in Python

The following error occurs when installing numpy.

shell
ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly

After you update your version of pip, run the following command.

shell
pip install numpy pip3 install numpy python -m pip install numpy python3 -m pip install numpy # ๐Ÿ‘‡๏ธ For Anaconda conda install -c anaconda numpy

# ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

The following error occurs when installing cryptography.

shell
ERROR: Failed building wheel for cryptography Running setup.py clean for cryptography Failed to build cryptography ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

After you update your version of pip, run the following command.

shell
pip install cryptography pip3 install cryptography python -m pip install cryptography python3 -m pip install cryptography # ๐Ÿ‘‡๏ธ For Anaconda conda install -c anaconda cryptography

# ERROR: Could not build wheels for psutil in Python

The following error occurs when installing psutil.

shell
ERROR: Failed building wheel for psutil Failed to build psutil ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

error could not build wheels for psutil

After you update your version of pip, run the following command.

shell
pip install psutil pip3 install psutil python -m pip install psutil python3 -m pip install psutil # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge psutil

As the installation page of psutil notes, pre-compiled wheels are available for Linux, Windows and macOS, so you don't have to install a C compiler.

Running the pip install psutil command should be sufficient.

If that doesn't work, try installing from sources if you are on Linux.

shell
# ๐Ÿ‘‡๏ธ For Debian (Ubuntu) sudo apt-get install gcc python3-dev pip install --no-binary :all: psutil # ๐Ÿ‘‡๏ธ For RedHad / CentOS sudo yum install gcc python3-devel pip install --no-binary :all: psutil

# ERROR: Could not build wheels for gevent in Python

The following error occurs when installing gevent.

shell
Failed to build gevent ERROR: Could not build wheels for gevent, which is required to install pyproject.toml-based projects

First, make sure to install the prerequisites.

shell
# ๐Ÿ‘‡๏ธ For Debian (Ubuntu) sudo apt-get install python3.10-dev linux-headers-virtual make gcc libtool # ๐Ÿ‘‡๏ธ For Fedora yum install python3-devel gcc kernel-devel kernel-headers make diffutils file # ๐Ÿ‘‡๏ธ For Alpine Linux apk add --virtual build-deps file make gcc musl-dev libffi-dev

You can read more about the prerequisites in the installation section of gevent's pypi page.

After you update your version of pip, use the following command to install gevent.

shell
pip install gevent pip3 install gevent python -m pip install gevent python3 -m pip install gevent # ๐Ÿ‘‡๏ธ For Anaconda conda install -c anaconda gevent

# ERROR: Could not build wheels for pycairo in Python

The following error occurs when installing pycairo.

shell
ERROR: Failed building wheel for pycairo Failed to build pycairo ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

error could not build wheels for pycairo

The first thing you should try is to install the dependencies.

shell
sudo apt install libcairo2-dev libcairo2 pkg-config sox ffmpeg pip install pycairo # ๐Ÿ‘‡๏ธ If you use manim animation engine pip install manimlib pip install manimce

After updating your version of pip, use the following command to install pycairo.

shell
pip install pycairo pip3 install pycairo python -m pip install pycairo python3 -m pip install pycairo

# ERROR: Could not build wheels for pycuda in Python

The following error occurs when installing pycuda.

shell
ERROR: Failed building wheel for pycuda Failed to build pycuda ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects

error could not build wheels for pycuda

First, if you are on Linux, install the prerequisites.

shell
# ๐Ÿ‘‡๏ธ Debian (Ubuntu) sudo apt-get install python3-dev # ๐Ÿ‘‡๏ธ CentOS, RHEL sudo yum install python3-devel # ๐Ÿ‘‡๏ธ Fedora sudo dnf install python3-devel # ๐Ÿ‘‡๏ธ openSUSE sudo zypper in python3-devel # ๐Ÿ‘‡๏ธ Alpine sudo apk add python3-dev # ๐Ÿ‘‡๏ธ Cygwin apt-cyg install python3-devel

After updating your version of pip, use the following command to install pycuda.

shell
pip install pycuda pip3 install pycuda python -m pip install pycuda python3 -m pip install pycuda # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge pycuda

# ERROR: Could not build wheels for tokenizers in Python

The following error occurs when installing tokenizers.

shell
ERROR: Failed building wheel for tokenizers Failed to build tokenizers ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

First, make sure you have a Rust compiler installed.

shell
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh export PATH="$HOME/.cargo/bin:$PATH" source $HOME/.cargo/env pip install tokenizers

You can read more about the prerequisites in the pypi page of tokenizers.

After updating your version of pip, use the following command to install tokenizers.

shell
pip install tokenizers pip3 install tokenizers python -m pip install tokenizers python3 -m pip install tokenizers # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge tokenizers

# ERROR: Could not build wheels for yarl, multidict in Python

The following error occurs when installing discord.py.

shell
ERROR: Failed building wheel for multidict Failed to build yarl multidict ERROR: Could not build wheels for yarl, multidict which use PEP 517 and cannot be installed directly

Note that the discord.py module requires Python v3.8+.

After updating your version of pip, run the following command to install discord.py.

shell
pip install discord.py pip3 install discord.py python -m pip install discord.py python3 -m pip install discord.py # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge discord.py

# ERROR: Could not build wheels for xmlsec in Python

The following error occurs when installing xmlsec in Python.

shell
ERROR: Failed building wheel for xmlsec Failed to build xmlsec ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects

error could not build wheels for xmlsec

First, install the prerequisites for your operating system.

shell
# ๐Ÿ‘‡๏ธ for macOS brew install libxml2 libxmlsec1 pkg-config # ๐Ÿ‘‡๏ธ for Windows pip install xmlsec --no-binary=xmlsec # ๐Ÿ‘‡๏ธ for Debian (Ubuntu) sudo apt-get install pkg-config libxml2-dev libxmlsec1 libxmlsec1-dev libxmlsec1-openssl # ๐Ÿ‘‡๏ธ for CentOS yum install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel # ๐Ÿ‘‡๏ธ for Fedora dnf install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel # ๐Ÿ‘‡๏ธ for Alpine apk add build-base libressl libffi-dev libressl-dev libxslt-dev libxml2-dev xmlsec-dev xmlsec
These are packages that xmlsec depends on that are not included in the module.

You can read more about the prerequisites in the pypi page of xmlsec.

If you are on Windows, running the pip install xmlsec --no-binary=xmlsec command should be sufficient.

After updating your version of pip, run the following command to install xmlsec.

shell
pip install xmlsec pip3 install xmlsec python -m pip install xmlsec python3 -m pip install xmlsec # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge xmlsec

# ERROR: Could not build wheels for bcrypt in Python

The following error occurs when installing bcrypt in Python.

shell
ERROR: Failed building wheel for bcrypt ERROR: Could not build wheels for bcrypt which use PEP 517 and cannot be installed directly

First, if you are on Linux, make sure to install the prerequisites.

shell
# ๐Ÿ‘‡๏ธ for Debian (Ubuntu) sudo apt-get install build-essential cargo # ๐Ÿ‘‡๏ธ for Fedora and RHEL-derivatives sudo yum install gcc cargo # ๐Ÿ‘‡๏ธ for Alpine apk add --update musl-dev gcc cargo

You can read more about the prerequisites in the pypi page of bcrypt.

After updating your version of pip, use the following command to install bcrypt.

shell
pip install bcrypt pip3 install bcrypt python -m pip install bcrypt python3 -m pip install bcrypt # ๐Ÿ‘‡๏ธ using Anaconda conda install -c anaconda bcrypt

# ERROR: Could not build wheels for hdbscan in Python

The following error occurs when installing hdbscan in Python.

shell
ERROR: Failed building wheel for hdbscan ERROR: Could not build wheels for hdbscan which use PEP 517 and cannot be installed directly

error could not build wheels for hdbscan

If you use anaconda, try installing the package with the following command.

shell
conda install -c conda-forge hdbscan

You should also install the python3.X-dev package because packages that compile C Python modules during installation require the python-dev package.

shell
sudo apt-get install python3.10-dev

After updating your version of pip, use the following command to install hdbscan.

shell
pip install hdbscan --upgrade pip3 install hdbscan --upgrade python -m pip install hdbscan --upgrade python3 -m pip install hdbscan --upgrade

# ERROR: Could not build wheels for PyNaCl in Python

The following error occurs when installing PyNaCl in Python.

shell
ERROR: Failed building wheel for PyNaCl ERROR: Could not build wheels for PyNaCl which use PEP 517 and cannot be installed directly

After updating your version of pip, use the following command to install PyNaCl.

shell
pip install PyNaCl pip3 install PyNaCl python -m pip install PyNaCl python3 -m pip install PyNaCl # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge pynacl

# ERROR: Could not build wheels for onnx in Python

The following error occurs when installing onnx in Python.

shell
ERROR: Failed building wheel for onnx Failed to build onnx ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects

First, if you are on Linux, install the prerequisites.

shell
sudo apt-get install python3-pip python3-dev libprotobuf-dev protobuf-compiler

If you use Anaconda, you can also try installing the package using conda-forge.

shell
conda install -c conda-forge numpy protobuf libprotobuf conda install -c conda-forge onnx

After updating your version of pip, use the following command to install onnx.

shell
pip install numpy protobuf pip install onnx pip3 install numpy protobuf pip3 install onnx python -m pip install numpy protobuf python -m pip install onnx python3 -m pip install numpy protobuf python3 -m pip install onnx # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge numpy protobuf libprotobuf conda install -c conda-forge onnx

# ERROR: Could not build wheels for spacy in Python

The following error occurs when installing spacy in Python.

shell
ERROR: Failed building wheel for spacy Failed to build spacy ERROR: Could not build wheels for spacy, which is required to install pyproject.toml-based projects

First, if you are on Linux, install the prerequisites.

shell
sudo apt-get install build-essential python-dev git

After updating your version of pip, use the following command to install spacy.

shell
# ๐Ÿ‘‡๏ธ In a virtual environment or using Python 2 pip install -U spacy python -m spacy download en_core_web_sm # ๐Ÿ‘‡๏ธ For python 3 (could also be pip3.10 depending on your version) pip3 install -U spacy python -m spacy download en_core_web_sm # ๐Ÿ‘‡๏ธ If you get a permissions error sudo pip3 install -U spacy python -m spacy download en_core_web_sm # ๐Ÿ‘‡๏ธ If you don't have pip in your PATH environment variable python -m pip install -U spacy python -m spacy download en_core_web_sm # ๐Ÿ‘‡๏ธ For python 3 (could also be pip3.10 depending on your version) python3 -m pip install -U spacy python3 -m spacy download en_core_web_sm # ๐Ÿ‘‡๏ธ For Anaconda conda install -c conda-forge spacy python -m spacy download en_core_web_sm

# ERROR: Could not build wheels for sip in Python

The following error occurs when installing sip in Python.

shell
ERROR: Failed building wheel for sip Failed to build sip ERROR: Could not build wheels for sip, which is required to install pyproject.toml-based projects

After updating your version of pip, use the following command to install sip.

shell
pip install sip pip3 install sip python -m pip install sip python3 -m pip install sip # ๐Ÿ‘‡๏ธ For Anaconda conda install -c anaconda sip

# Could not build wheels for scipy which use PEP 517 and cannot be installed directly

The following error occurs when installing scipy in Python.

shell
ERROR: Failed building wheel for scipy ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly

After updating your version of pip, use the following command to install scipy.

shell
pip install scipy pip3 install scipy python -m pip install scipy python3 -m pip install scipy # ๐Ÿ‘‡๏ธ alternative for Debian (Ubuntu) sudo apt-get install python3-scipy # ๐Ÿ‘‡๏ธ Alternative for Fedora sudo dnf install python3-scipy # ๐Ÿ‘‡๏ธ Alternative for macOS brew install scipy

# Conclusion

To solve the error "Could not build wheels for X which use PEP 517 and cannot be installed directly", run the pip install --upgrade pip command to upgrade your pip version and rerun the pip install <package-name> command.

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