Python "Backend ... is not available" Building a Wheel in CI
The PEP 517 front-end (pip or build) tried to load the build-backend named in pyproject.toml and could not import it. The backend module is misspelled, not declared in requires, or not installed in a no-isolation build.
What this error means
A wheel/sdist build fails immediately with "Cannot import build backend" or "Backend object ... is not available", naming the backend string from [build-system] build-backend. Nothing compiles because the front-end cannot even load the backend.
ERROR Backend 'flit_core.buildapi' is not available.
ModuleNotFoundError: No module named 'flit_core'Common causes
Backend not listed in [build-system] requires
The build-backend points at a module (e.g. flit_core.buildapi, hatchling.build) whose package is not in requires, so an isolated build never installs it.
Typo or wrong backend string
The build-backend value is misspelled or points at a non-existent object path, so the front-end cannot import it.
How to fix it
Declare the backend in requires and fix the string
Make requires include the backend package and ensure build-backend is the correct object path.
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"Install the backend for no-isolation builds
When isolation is disabled, the backend must already be present.
pip install flit_core
python -m build --no-isolationHow to prevent it
- Keep
[build-system] requiresandbuild-backendconsistent. - Copy the backend’s exact
build-backendstring from its docs. - Prefer isolated builds so
requiresis provisioned automatically.