You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

M1芯片MacOS Monterey运行Aerospike Python客户端报错求助

MacOS Monterey M1芯片运行Aerospike Python客户端解决方案

方案1:Rosetta 2模拟x86环境(兼容旧版本5.0.0)

  • 安装Rosetta 2,终端执行:softwareupdate --install-rosetta --agree-to-license
  • 打开访达-应用程序-实用工具,右键点击「终端」,选择「显示简介」,勾选「使用Rosetta打开」,关闭所有终端窗口后重新打开
  • 验证架构,终端执行arch,输出i386即为配置成功
  • 此时直接执行pip install aerospike==5.0.0即可正常安装,导入也不会触发架构不兼容报错

方案2:原生arm64运行(推荐,无需模拟)

Aerospike Python客户端从6.0.0版本开始原生支持Apple Silicon架构,不需要降级Python或者用模拟环境:

  • 先确认你的Python为arm64原生版本,执行:python3 -c "import platform; print(platform.machine())",输出arm64即为符合要求
  • 先安装C客户端依赖:brew install aerospike-client-c
  • 安装支持M1的客户端版本:pip install aerospike>=6.0.0

常见报错说明

  • 降级Python3.7出现ModuleNotFoundError: No module named '_ctypes'是因为M1架构下pyenv编译Python3.7时缺少libffi依赖,需先执行brew install libffi再重新编译Python3.7,不推荐用该方案,旧版本Python对M1适配性很差
  • Docker安装报错是因为默认启动的是arm64架构容器,下载的deb包为x86版本,启动容器时添加--platform linux/amd64参数指定x86架构即可正常安装

内容的提问来源于stack exchange,提问作者Mudits

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.24 01:15:03