在macOS BigSur上使用Python 3.9.1安装Numpy 1.19.5时出现问题

wlp8pajw  于 11个月前  发布在  Mac
关注(0)|答案(1)|浏览(231)

就像标题说的,我在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


我也会得到类似的错误。提前感谢!

2q5ifsrm

2q5ifsrm1#

这是因为Numpy还不能用于python 3.9版本。只需使用3.8版本创建一个新的conda环境:

conda create -n ENV_NAME python=3.8.5

字符串
通过pip安装Numpy

pip install numpy


在M1和macOS Big Sur上运行起来很有魅力。这个解决方案也是这个GitHub问题的输出:https://github.com/numpy/numpy/issues/17807

相关问题