8

I'm quite new to machine learning and when I tried to install numpy and this happended Can you guys help me fix this. I'm using python 3.10.0

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

Gulzar
  • 23,452
  • 27
  • 113
  • 201
Johnny
  • 81
  • 1
  • 1
  • 2
  • Welcome to SO. Please provide a bit more detail. Like what your operating system is and how you're installing numpy as well as the full error. – ewokx Oct 18 '21 at 01:46
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 18 '21 at 08:55
  • Does this answer your question? [trying to install numpy in python3.9 and getting error in preparing wheel metadata in windows 10. I did not checked using virtual environment](https://stackoverflow.com/questions/64256526/trying-to-install-numpy-in-python3-9-and-getting-error-in-preparing-wheel-metada) – Gulzar Mar 03 '22 at 12:37
  • This is asked every new version. I wish it were more Google-searchable [answer](https://stackoverflow.com/q/64256526/913098) – Gulzar Mar 03 '22 at 12:38

3 Answers3

6

I faced the same issue, I have a macos high sierra with python 3.10 and I have the same error while installing numpy in pip. I managed to solve the problem by installing not the newest numpy 1.22.2 in pip. I install version 1.22.1.

Command:

pip install numpy==1.22.1
Flair
  • 2,609
  • 1
  • 29
  • 41
DGS
  • 121
  • 2
  • 3
5

Numpy has not yet released a precompiled wheel for Python 3.10. What you can do, is downgrade to python 3.9. If you don't want to do this, you can try the unofficial wheels available here.

These are the important ones you should look for:

  • numpy‑1.21.2+mkl‑cp310‑cp310‑win_amd64.whl
  • numpy‑1.21.2+mkl‑cp310‑cp310‑win32.whl

(Choose based on your OS architecture)

Then download the file, go to your downloads folder, and run pip install "<your_filename_choice>.whl").

You could also just use the pipwin module. Do this:

pip install pipwin

and then

pipwin install numpy
krmogi
  • 2,588
  • 1
  • 10
  • 26
1

Note that wheels have been available for Python 3.10 since 5th November, see:

https://pypi.org/project/numpy/#files

specifically, I can see Python wheels for labelled as version cp310 (i.e. CPython 3.10) for Linux, Mac and Windows.

Sam Mason
  • 15,216
  • 1
  • 41
  • 60