ERROR pip build_error ai_generated true

ERROR: Could not install packages due to a BuildBackendException: Backend 'setuptools.build_meta' is not available. The project requires the following build dependencies: wheel, setuptools>=61.0. Check that these are installed and available in the build environment.

ID: pip/pep-517-backend-requires-missing-dependency

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
1Evidence
2023-09-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
pip 23.1 active
pip 23.3 active
pip 24.0 active
setuptools 68.0 active

Root Cause

The build system specified in pyproject.toml (requires) lists dependencies that are not installed in the pip build environment, often because --no-build-isolation is used or the build environment lacks those packages.

generic

中文

pyproject.toml 中指定的构建系统(requires)列出的依赖项未安装在 pip 构建环境中,通常是因为使用了 --no-build-isolation 或构建环境缺少这些软件包。

Official Documentation

https://pip.pypa.io/en/stable/reference/build-system/

Workarounds

  1. 85% success Ensure build isolation is enabled (default) and pip will automatically install the required build dependencies in the isolated environment. If you must use --no-build-isolation, pre-install the exact versions required: pip install 'setuptools>=61.0' wheel
    Ensure build isolation is enabled (default) and pip will automatically install the required build dependencies in the isolated environment. If you must use --no-build-isolation, pre-install the exact versions required: pip install 'setuptools>=61.0' wheel
  2. 75% success Upgrade pip to the latest version to ensure it correctly handles PEP 517/518 build requirements: pip install --upgrade pip
    Upgrade pip to the latest version to ensure it correctly handles PEP 517/518 build requirements: pip install --upgrade pip
  3. 80% success Manually create a build environment with the required dependencies and then install the package using pip install --no-build-isolation ./package-dir after activating that environment.
    Manually create a build environment with the required dependencies and then install the package using pip install --no-build-isolation ./package-dir after activating that environment.

中文步骤

  1. 确保构建隔离已启用(默认),pip 将自动在隔离环境中安装所需的构建依赖项。如果必须使用 --no-build-isolation,请预先安装确切的所需版本:pip install 'setuptools>=61.0' wheel
  2. 将 pip 升级到最新版本,以确保其正确处理 PEP 517/518 构建要求:pip install --upgrade pip
  3. 手动创建具有所需依赖项的构建环境,然后在激活该环境后使用 pip install --no-build-isolation ./package-dir 安装软件包。

Dead Ends

Common approaches that don't work:

  1. Installing the missing build dependencies globally with pip install setuptools wheel 90% fail

    If pip is using build isolation (default), it creates a temporary build environment that does not inherit global packages; the global install has no effect.

  2. Adding --no-build-isolation without ensuring the build environment has the correct versions 70% fail

    The global environment may have older versions of setuptools that do not satisfy the >=61.0 requirement.

  3. Deleting pyproject.toml to force legacy setup.py install 85% fail

    Modern packages may not have a setup.py, and pip will refuse to install without a build backend.