正如标题所说,我在macOS Big Sur11.1上使用苹果硅片。我刚刚从python.org上的可下载链接安装了Python3.9.1。当我尝试安装Numpy 1.19.5时,如下所示:
python3 -m pip install numpy -U
我得到了以下(截断的)输出:
Collecting numpy
Using cached numpy-1.19.5.zip (7.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: numpy
Building wheel for numpy (PEP 517) ... error
.
.
.
----------------------------------------
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
我尝试过将numpy降级如下:
python3 -m pip install numpy==1.15.3
我得到了类似的错误。提前感谢!
发布于 2021-02-07 19:47:48
这是因为Numpy还不能用于python版本3.9。只需使用3.8版创建一个新的conda环境:
conda create -n ENV_NAME python=3.8.5
..。并通过pip安装Numpy
pip install numpy
在M1和macOS Big上的工作就像一个护身符。此解决方法也是此GitHub问题的输出:https://github.com/numpy/numpy/issues/17807
https://stackoverflow.com/questions/65708176
复制相似问题