NumPy 1.21.2 may not yet support Python 3.10

Solution 1:

If on Windows, numpy has not yet released a precompiled wheel for Python 3.10. However you can try the unofficial wheels available at https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy . Specifically look for

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

depending on you system architecture.

After downloading the file go to the download directory and run pip install "<filename>.whl".)

(I have personally installed numpy‑1.21.2+mkl‑cp310‑cp310‑win_amd64.whl and it worked for me.)

Solution 2:

Since you are on MS-Windows you can also make use of pipwin - this windows only utility is pip installable and can download and install a number of "unofficial" builds (provided by the excellent Christoph Gohlke) of scientific from the https://www.lfd.uci.edu/~gohlke/pythonlibs/ but takes the guesswork out of which file(s) to download and install.

A session might run:

pip install pipwin
pipwin install numpy

Alternatively you could use the py launcher as in:

py -3.10 -mpip install pipwin
py -3.10 -mpipwin refresh
py -3.10 -mpipwin install numpy

The middle step tells pipwin to populate its list of what is currently available.