Getting an error saying “Could not build wheels for numpy which use PEP 517 and cannot be installed directly” while installing numpy

We Are Going To Discuss About Getting an error saying “Could not build wheels for numpy which use PEP 517 and cannot be installed directly” while installing numpy. So lets Start this Python Article.

Getting an error saying “Could not build wheels for numpy which use PEP 517 and cannot be installed directly” while installing numpy

  1. How to solve Getting an error saying “Could not build wheels for numpy which use PEP 517 and cannot be installed directly” while installing numpy

    I was facing the same error on my MacBook Air(macOS BigSur) Laptop while installing the Numpy package via integrated terminal of VS Code. And I found the solution:
    So previously I was using older version of pip i.e. 19.2.3.
    But when I upgraded it to the latest version using command
    pip install --upgrade pip
    and after that when running the command
    pip install numpy
    it worked absolutely fine.
    At the time running the above commands, my python version was 3.8.2.

  2. Getting an error saying “Could not build wheels for numpy which use PEP 517 and cannot be installed directly” while installing numpy

    I was facing the same error on my MacBook Air(macOS BigSur) Laptop while installing the Numpy package via integrated terminal of VS Code. And I found the solution:
    So previously I was using older version of pip i.e. 19.2.3.
    But when I upgraded it to the latest version using command
    pip install --upgrade pip
    and after that when running the command
    pip install numpy
    it worked absolutely fine.
    At the time running the above commands, my python version was 3.8.2.

Solution 1

I was facing the same error on my MacBook Air(macOS BigSur) Laptop while installing the Numpy package via integrated terminal of VS Code. And I found the solution:
So previously I was using older version of pip i.e. 19.2.3.
But when I upgraded it to the latest version using command

pip install --upgrade pip

and after that when running the command

pip install numpy 

it worked absolutely fine.

At the time running the above commands, my python version was 3.8.2.

Original Author Kashish Khurana Of This Content

Solution 2

I think NumPy is not yet being prepared for Python 3.9 since they need to check a lot of times. You should try Python 3.7 or 3.8 is better.

See this thread: https://github.com/numpy/numpy/issues/17569

Edit: Based on the latest news on numpy’s website (dated 31st December) Numpy appears to now be supporting python 3.9 and 3.10 as well

Original Author dhgoratela Of This Content

Solution 3

Similarly to the answers above, switching to Python 3.8 solved the issue. Additionally, because of this issue, I couldn’t install scikit-image which depends on numpy.

I created a virtual environment of Python 3.8 using conda i.e. conda create -n py38 python=3.8 to switch python version. I have Mac M1, 2020 updated to OS Monterey, version 12.0.1.

Original Author vpap Of This Content

Solution 4

If you’re on Windows, then install Visual Studio 2019 Build Tools, then go to ‘Individual components’, then tick the latest version of ‘Windows 10 SDK’, and ‘MSVC v142 x64/86 build tools – Latest’. That solved this error for me, except for me this error came when installing discord.py.

Try seeing if it works with Python 3.8 first though, just like Dhananjay’s answer. That could save you a lot of storage, because Visual Studio takes up lots of space. If that doesn’t work, you can try my answer.

Edit: I just realised, you said you’re on Mac. Try this:

  • type python -VV in terminal
  • It should say something like this:
Python 3.9.6 (default, Jun 29 2021, 10:19:25)
[GCC 10.3.0]

Whatever it says on the second line is what you will need to install. I use Python on Ubuntu 21.10 on WSL2, which uses GCC 10.3.0, and I have GCC 10.3.0 installed.

Original Author some random nerd Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment