就像标题说的,我在macOS Big Sur 11.1上使用Apple silicon。我刚刚从python. org上的下载链接安装了Python 3.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
型
我也会得到类似的错误。提前感谢!
1条答案
按热度按时间2q5ifsrm1#
这是因为Numpy还不能用于python 3.9版本。只需使用3.8版本创建一个新的conda环境:
字符串
通过pip安装Numpy
型
在M1和macOS Big Sur上运行起来很有魅力。这个解决方案也是这个GitHub问题的输出:https://github.com/numpy/numpy/issues/17807