M1 Big Sur 11.1中的numpy构建失败 [英] numpy build fail in M1 Big sur 11.1

查看:77
本文介绍了M1 Big Sur 11.1中的numpy构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用运行Big Sur 11.1的MacBook m1,并且已安装 Xcode-commandline-tools 版本12.3,并且已安装 python3.8.5 pip3 .python3和pip是本机应用程序,即它们在ARM中运行

I am using MacBook m1 which is running Big Sur 11.1 ,and I have installed Xcode-commandline-tools version 12.3 and it has installed python3.8.5 and pip3 .python3 and pip are native apps,that is they run in ARM

pip3 版本 20.3.3

python3 版本 3.8.5

setuptools 版本 51.0.0

wheel 版本 0.36.2

当我键入 python3 -m pip install numpy

输出为:

Defaulting to user installation because normal site-packages is not writeable
Collecting numpy
  Using cached numpy-1.19.4.zip (7.3 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517): started
sandeep@Sandeeps-Air ~ % cat a
Defaulting to user installation because normal site-packages is not writeable
Collecting numpy
  Using cached numpy-1.19.4.zip (7.3 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517): started
  Building wheel for numpy (PEP 517): finished with status 'error'
Failed to build numpy

,其中包含大量错误

M1是否仍不支持numpy或我做错了吗?

Is numpy still not supported in M1 or am I doing it wrong ?

推荐答案

我的全新Mac Mini遇到了完全相同的问题.在度过一个下午在github上阅读此问题之后,我终于成功了.但是,它似乎只能在在v1.20.0rc2 或更高版本中使用...

I had exactly the same issue with my brand new Mac Mini. After spending an afternoon reading this issue on github, I finally succeeded. However, it only seems to work with v1.20.0rc2 or above...

长话短说,以下是我为使其正常运行所采取的步骤:

Long story short, these were the steps I've taken to get it working:

pip3 install Cython
git clone https://github.com/numpy/numpy.git 
cd numpy
pip3 install . --no-binary :all: --no-use-pep517

在那之后,我可以 cd 进入我的virtualenv并导入numpy:

After that, I could cd into my virtualenv and import numpy:

>>> import numpy as np
>>> np.__version__
'1.21.0.dev0+402.gc4ae3ce64'
>>> 

接下来:熊猫.

更新:经过更多搜索后,我发现了这篇有趣的文章,指出您可以轻松地在Rosatta模式下启动Terminal.那也解决了问题.

UPDATE: After some more searching, I found this interesting article, which states that you can easily start Terminal in Rosatta mode. That also solved the issues.

但是,我正在使用无头Mac Mini,因此我仍然必须找出该解决方案在特定设置中是否还可行.

However, I am working with a headless Mac Mini, so I still have to find out whether that solution also is feasable in that particular setup.

更新 2

由于关于SO的答案,我现在也有熊猫在工作.

I now have pandas working as well, thanks to this answer on SO.

这篇关于M1 Big Sur 11.1中的numpy构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆