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

Python 3.10环境安装numpy失败无法构建wheel问题求助

ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

排查解决步骤
  • 第一步:升级基础安装工具
    执行命令:
    pip install --upgrade pip setuptools wheel

    旧版本的pip、setuptools、wheel无法适配Python3.10的包构建规则,70%以上的同类报错升级后重新执行pip install numpy即可解决。

  • 第二步:指定适配Python3.10的numpy版本安装
    如果升级后仍然报错,执行命令:
    pip install numpy==1.21.6

    numpy从1.21.0版本开始支持Python3.10,1.21.6是1.21分支的最终稳定版,官方提供了对应Python3.10的预编译wheel包,不需要本地编译即可直接安装。

  • 第三步:对应系统额外排查
    • Windows系统:确认安装的Python3.10为官方正式发布版本,且Python架构和系统架构一致(64位系统安装64位Python,32位系统安装32位Python),确认后再次执行安装命令即可。
    • Linux系统:先安装编译依赖,Debian/Ubuntu系列执行命令:
      sudo apt install gcc gfortran python3.10-dev libopenblas-dev liblapack-dev
      依赖安装完成后再重新安装numpy。
  • 第四步:虚拟环境隔离
    如果上述步骤都无效,卸载现有全局numpy后创建虚拟环境安装,避免全局依赖冲突:
    python -m venv ml_env
    # Windows激活:ml_env\Scripts\activate
    # Linux/macOS激活:source ml_env/bin/activate
    pip install numpy
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.29 18:36:05