One - One Code All

Blog Content

Python:#error architecture not supported

Python Linux-Mac   2020-04-17 18:13:44

错误,主要和CPU架构有关,因为不同的CPU架构可能会使用不同的指令集(复杂指令集/精简指令集)。

默认把我的MAC的CPU当作了ARM64架构,才出现此错误。


解决方法:

ARCHFLAGS="-arch x86_64" pip install package

上面命令中:ARCHFLAGS="-arch x86_64" 就是直接告诉它我的CPU架构是什么类型,这样就可以避免出问题了。

mac电脑可以使用如下命令查看CPU信息:

sysctl machdep.cpu.brand_string

如果是Intel的,那就是x86_64类型。




上一篇:结巴分词缓存预热及环境变量TMP查看
下一篇:python - Pyephem - datetime.datetime 和 ephem.Date 之间的时间差

The minute you think of giving up, think of the reason why you held on so long.