Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to install numpy in python version 3.9

Tags:

python

numpy

I'm a beginner in python. When I want to install NumPy, I didn't work, and especially when the execution reaches this line "Preparing wheel metadata" and here is the error:

C:\Users\dell>pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Collecting numpy
  Using cached numpy-1.19.2.zip (7.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' 'c:\program files\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\dell\AppData\Local\Temp\tmphnzlje19' Check the logs for full command output.

like image 687
Zidan Badr Avatar asked Oct 22 '25 14:10

Zidan Badr


1 Answers

This pip install command is attempting to build numpy from source. You can see this because a .zip file is being downloaded instead of a wheel .whl file. The .zip file contains the source code. Much of NumPy is written in C and needs to be compiled, but it is likely the case that your computer does not have a compiler installed. A wheel (.whl) file does not need to be compiled -- it includes already compiled code, so you do not need a compiler.

EDIT (December 15, 2020): wheel files are available for version 1.19.4, so one can use pip install numpy with python 3.9.

According to https://pypi.org/project/numpy/#files, there is no wheel file yet for python 3.9, so your options are to build numpy from source, use python 3.8 until a numpy wheel comes out for python 3.9, or use conda, which already distributes numpy for python 3.9.

like image 100
jakub Avatar answered Oct 25 '25 04:10

jakub



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!