Can't install numpy on python 3.10

Viewed 6549

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

3 Answers

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

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

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.

Related