美文网首页
macbook M1芯片 使用numpy报错:(have 'ar

macbook M1芯片 使用numpy报错:(have 'ar

作者: 小喜_ww | 来源:发表于2022-09-14 16:30 被阅读0次

运行import numpy报错信息大致如下:

(mach-o file, but is an incompatible architecture(have 'arm64', need 'x86_64'))

解决办法:
1、查看当前架构uname -a

Darwin MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64

2、切换架构 arch -x86_64 zsh
3、再次查看架构uname -a

Darwin MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 x86_64

4、卸载numpy,重新安装

 > pip3 uninstall numpy
 > pip3 install numpy

相关文章

网友评论

      本文标题:macbook M1芯片 使用numpy报错:(have 'ar

      本文链接:https://www.haomeiwen.com/subject/lmqlortx.html