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

使用pip安装openai[embeddings]时Scipy依赖安装错误求助

解决MacOS下pip安装openai[embeddings]时Scipy依赖失败的问题

错误核心

编译Scipy时找不到OpenBLAS依赖,同时缺少CMake工具,导致元数据生成失败。

解决方案

方案一:安装系统依赖后编译安装

  1. 用Homebrew安装OpenBLAS和CMake:
    brew install openblas cmake
    
  2. 设置环境变量让编译系统定位到OpenBLAS,再执行安装:
    OPENBLAS=$(brew --prefix openblas) CFLAGS="-I$OPENBLAS/include" LDFLAGS="-L$OPENBLAS/lib" pipenv install openai[embeddings]
    

方案二:安装预编译的Scipy Wheel(推荐,无需编译)

直接安装针对Apple Silicon优化的预编译Scipy包,跳过编译环节:

  1. 先安装预编译Scipy:
    pipenv run pip install --only-binary :all: scipy
    
  2. 再安装openai[embeddings]:
    pipenv install openai[embeddings]
    

注意事项

  • 确保Homebrew的路径已加入系统环境变量,避免编译工具找不到依赖。
  • Intel架构Mac也适用上述方案,预编译wheel会自动匹配对应架构。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.26 16:07:55