python install_error ai_generated true

error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [12 lines of output] ModuleNotFoundError: No module named 'Cython'

ID: python/pip-subprocess-exited-with-error-build-backend

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
0Evidence
2024-03-15First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

The package's build backend requires build-time dependencies (Cython, numpy, etc.) that are not declared in pyproject.toml's [build-system].requires, so the isolated build environment lacks them.

generic

中文

包的构建后端需要构建时依赖项(Cython、numpy 等),但这些依赖项未在 pyproject.toml 的 [build-system].requires 中声明,因此隔离的构建环境缺少它们。

Workarounds

  1. 85% success
    python -m pip install Cython numpy
    python -m pip install --no-build-isolation mypkg
  2. 90% success
    # If the project ships pyproject.toml with [build-system].requires
    python -m pip install build
    python -m build  # installs build-system.requires automatically

Dead Ends

Common approaches that don't work:

  1. 80% fail

    PEP 517 build isolation uses a fresh env; packages in your venv are invisible to the build.

  2. 90% fail

    The missing dependency is deterministic; retrying produces identical failure.