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

18,900

I solved it by doing the following steps:-

  1. I updated the pyproject.toml(This file contains all the library/dependency/dev dependency)with the numpy version that I installed using pip install numpy command. enter image description here

  2. Run poetry lock to update poetry.lock file(contains details information about the library) enter image description here

  3. Run poetry install again, & it should work fine.

If you are having any problems, you can comment. I`ll try to answer it.

Share:
18,900
Lakshay Rohilla
Author by

Lakshay Rohilla

Updated on August 02, 2022

Comments

  • Lakshay Rohilla
    Lakshay Rohilla over 1 year

    I`m using python poetry(https://python-poetry.org/) for dependency management in my project.

    Though when I`m running poetry install, its giving me below error.

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

    I`m having python 3.9 installed in my laptop.
    I installed numpy 1.21.5 using pip install numpy, I even tried to down version it to 1.19.5.

    Though I`m getting the same error.

    I found out many people are getting ERROR: Failed building wheel for numpy this error in python 3.10, they solved it by down versioning python to 3.9, though that didnt working for me.

    • Aditya Singh
      Aditya Singh about 2 years
      Having this same issue. Were you able to solve this?
  • ediordna
    ediordna about 2 years
    This worked for me as well. The error came with numpy version 1.21.2 but not with 1.22.3. Please consider, that newer numpy versions, e.g. 1.22.3 requires Python 3.8 or newer. I had to update my pyproject.toml to respect this as well.
  • IgorGanapolsky
    IgorGanapolsky almost 2 years
    Xcode is required for numpy?