gpt4 book ai didi

python - 无法在 python 3.9 版中安装 numpy

转载 作者:行者123 更新时间:2023-12-04 01:12:46 25 4
gpt4 key购买 nike

我是python的初学者。
当我想安装 NumPy 时,我没有工作,尤其是当执行到达“准备车轮元数据”这一行时,这是错误:

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.

最佳答案

pip install命令正在尝试从源代码构建 numpy。你可以看到这是因为 .zip正在下载文件而不是轮子 .whl文件。 .zip文件包含源代码。 NumPy 的大部分内容是用 C 编写的,需要编译,但很可能是您的计算机没有安装编译器。轮子( .whl )文件不需要编译——它包含已经编译的代码,所以你不需要编译器。
编辑 (2020 年 12 月 15 日):1.19.4 版本提供轮子文件,因此可以使用 pip install numpy使用 python 3.9。
根据 https://pypi.org/project/numpy/#files ,python 3.9 还没有轮文件,所以你的选择是从源代码构建 numpy,使用 python 3.8 直到 python 3.9 的 numpy 轮出现,或者使用 conda , which already distributes numpy for python 3.9 .

关于python - 无法在 python 3.9 版中安装 numpy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64324901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com