pypa/pip · error · InstallationError

Project uses a build backend that is missing the…

Error message

Project {self} uses a build backend that is missing the 'build_editable' hook, so it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.

What it means

editable_sanity_check (req_install.py:511) verifies that a project being installed in editable mode (-e) uses a build backend implementing PEP 660's build_editable hook. Legacy backends or old setuptools versions lack this hook, so pip cannot produce an editable install and raises InstallationError instead of silently failing.

Solutions

  1. Upgrade build tooling: pip install -U setuptools wheel (setuptools >=64 supports PEP 660).
  2. Ensure pyproject.toml declares a PEP 660-capable backend under [build-system].
  3. Install non-editable (pip install .) as a workaround until the backend is upgraded.

Example fix

# before
pip install -e .
# after
pip install -U setuptools>=64 wheel && pip install -e .
Defensive patterns

Strategy: validation

Validate before calling

# Before pip install -e ., verify the backend exposes build_editable.
import tomllib, pathlib, subprocess, sys, json
pyproject = pathlib.Path("pyproject.toml")
if pyproject.exists():
    data = tomllib.loads(pyproject.read_text())
    bs = data.get("build-system", {})
    backend = bs.get("build-backend", "setuptools.build_meta")
    # ensure setuptools is new enough (>=64 has PEP 660)
    import importlib.metadata as md
    stv = md.version("setuptools")
    if tuple(map(int, stv.split(".")[:2])) < (6, 4) and "setuptools" in backend:
        subprocess.check_call([sys.executable, "-m", "pip", "install", "-U", "setuptools>=64"])

Prevention

When it happens

Trigger: Running `pip install -e .` on a project whose build backend (declared in pyproject.toml [build-system] or falling back to setup.py legacy) does not expose build_editable.

Common situations: Very old setuptools (<64); a custom/legacy build backend without PEP 660 support; project with only a setup.py and no pyproject.toml on an old setuptools.

Related errors


AI-assisted analysis of pypa/pip@f399c37189 (2026-08-08). Data as JSON: /api/errors/86c606f7a5b52189. Report an issue: GitHub.

Appendix: source

Thrown at src/pip/_internal/req/req_install.py:511

        This is done separately after pyproject.toml loading as the backend
        need to be called with the build environment's Python executable,
        which can vary."""
        self.pep517_backend = ConfiguredBuildBackendHookCaller(
            self,
            self.unpacked_source_directory,
            self._pep517_backend_spec,
            backend_path=self._pep517_backend_path,
            python_executable=python_executable,
        )

    def editable_sanity_check(self) -> None:
        """Check that an editable requirement if valid for use with PEP 517/518.

        This verifies that an editable has a build backend that supports PEP 660.
        """
        if self.editable and not self.supports_pyproject_editable:
            raise InstallationError(
                f"Project {self} uses a build backend "
                f"that is missing the 'build_editable' hook, so "
                f"it cannot be installed in editable mode. "
                f"Consider using a build backend that supports PEP 660."
            )

    def prepare_metadata(self, allow_editables: bool) -> None:
        """Ensure that project metadata is available.

        Under PEP 517 and PEP 660, call the backend hook to prepare the metadata.
        Under legacy processing, call setup.py egg-info.
        """
        assert self.source_dir, f"No source dir for {self}"
        details = self.name or f"from {self.link}"

        assert self.pep517_backend is not None
        if self.editable and allow_editables and self.supports_pyproject_editable:
            self.metadata_directory = generate_editable_metadata(

View on GitHub (pinned to f399c37189)