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

M1芯片Python3.10环境安装scikit-surprise遇bdist_wheel错误求助

解决M1芯片+Python3.10安装scikit-surprise失败的问题

核心原因

scikit-surprise官方包的C扩展未适配M1的arm64架构,且setup.py构建流程在Python3.10下存在兼容性问题,导致bdist_wheel构建失败。


方法1:编译依赖适配安装

  1. 安装编译所需工具与依赖库
    打开终端执行:
    brew install openblas cmake
    
  2. 设置环境变量,指定适配M1的线性代数库
    export OPENBLAS=/opt/homebrew/opt/openblas/lib/libopenblas.dylib
    export CFLAGS="-falign-functions=8 ${CFLAGS}"
    
  3. 重新执行安装命令
    pip install scikit-surprise
    

方法2:安装社区适配版本

如果方法1无效,可尝试社区维护的适配分支,该分支修复了Python3.10和M1的兼容性问题:

pip install git+https://github.com/NicolasHug/surprise.git@python-3.10-fix

方法3:conda环境备选方案

若pip方式始终报错,可切换到conda环境,conda-forge频道提供了预编译的适配包:

  1. 创建并激活conda环境
    conda create -n surprise_env python=3.10
    conda activate surprise_env
    
  2. 安装scikit-surprise
    conda install -c conda-forge scikit-surprise
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.22 19:39:27