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

Question:

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.

Asked By: Lakshay Rohilla

||

Answers:

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.

Answered By: Lakshay Rohilla

I had this trying to install numpy with PyPy on macOS.

I solved the issue by first running brew doctor, which showed that my Command Line Tools (XCode) were outdated. Then I just followed the instructions to update them:

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

This solved the issue.


My configuration:

  • macOS 12.2.1 Monterey
> python --version
Python 3.8.12 (9ef55f6fc369, Oct 25 2021, 05:10:01)
[PyPy 7.3.7 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]
Answered By: Kurt Bourbaki

Numpy error solved

Error: failed to build wheels for numpy which is required to install project.tmol

This error cause due to outdated numpy version simply run this command

MATHLAB = "m" pip install numpy

`

My python version:
Python -V=3.9

It doesn’t works in se case but most of the time works.

If you are working in venvthen try to install numpy in venv.
Then run your code it will be working
Fine
.

Answered By: ANDREW
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.