python install_error ai_generated true

错误:无法为 foo 构建 wheel,而这是安装基于 pyproject.toml 项目所必需的

ERROR: Could not build wheels for foo, which is required to install pyproject.toml-based projects

ID: python/pip-missing-build-backend

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2024-05-02首次发现

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

使用 PEP 517 构建系统的包无法生成 wheel,通常是因为缺少 C 编译器、头文件或构建依赖。

English

A package using PEP 517 build system failed to produce a wheel, typically due to missing C compiler, headers, or build dependencies.

generic

解决方案

  1. 90% 成功率
    On Debian/Ubuntu: `sudo apt-get install build-essential python3-dev`. On macOS: `xcode-select --install`. Then retry `pip install foo`.
  2. 80% 成功率
    `pip install --only-binary=:all: foo` or fetch a manylinux wheel from PyPI/conda-forge.

无效尝试

常见但无效的做法:

  1. 85% 失败

    Upgrading pip does not provide the missing system toolchain.

  2. 70% 失败

    Disabling build isolation can help only if build deps are preinstalled; usually they are not.