pypa/pip · error · HookMissing
build_editable
Error message
build_editable
What it means
During prepare_metadata_for_build_editable's fallback path, if the backend lacks prepare_metadata_for_build_editable AND also lacks build_editable, pyproject_hooks raises HookMissing(hook_name='build_editable'). The message is just the hook name 'build_editable', signaling the backend does not support editable installs.
Source
Thrown at src/pip/_vendor/pyproject_hooks/_in_process/_in_process.py:202
def prepare_metadata_for_build_editable(
metadata_directory, config_settings, _allow_fallback
):
"""Invoke optional prepare_metadata_for_build_editable
Implements a fallback by building an editable wheel if the hook isn't
defined, unless _allow_fallback is False in which case HookMissing is
raised.
"""
backend = _build_backend()
try:
hook = backend.prepare_metadata_for_build_editable
except AttributeError:
if not _allow_fallback:
raise HookMissing()
try:
build_hook = backend.build_editable
except AttributeError:
raise HookMissing(hook_name="build_editable")
else:
whl_basename = build_hook(metadata_directory, config_settings)
return _get_wheel_metadata_from_wheel(
whl_basename, metadata_directory, config_settings
)
else:
return hook(metadata_directory, config_settings)
WHEEL_BUILT_MARKER = "PYPROJECT_HOOKS_ALREADY_BUILT_WHEEL"
def _dist_info_files(whl_zip):
"""Identify the .dist-info folder inside a wheel ZipFile."""
res = []
for path in whl_zip.namelist():
m = re.match(r"[^/\\]+-[^/\\]+\.dist-info/", path)
if m:View on GitHub (pinned to d7d0d0a394)
Solutions
- Upgrade the build backend to a version that supports PEP 660 editable installs (e.g. setuptools>=64, hatchling, flit_core>=3.6).
- If editable install is optional, fall back to a regular install (pip install .) for that project.
- For a custom backend, implement build_editable (and optionally prepare_metadata_for_build_editable).
Example fix
# before requires = ["setuptools==63"] # running: pip install -e . # after requires = ["setuptools>=64"] # editable install now supported
Defensive patterns
Strategy: validation
Validate before calling
features = hook._supported_features()
if 'build_editable' not in features:
raise RuntimeError('backend does not support editable installs (PEP 660)') Try / catch
from pip._vendor.pyproject_hooks._impl import HookMissing
try:
hook.prepare_metadata_for_build_editable(md_dir)
except HookMissing as e:
if e.hook_name == 'build_editable':
log.warning('editable not supported; doing a regular install') Prevention
- Check _supported_features() for 'build_editable' before attempting -e installs.
- Keep the backend version current for PEP 660 support.
When it happens
Trigger: A build backend that predates PEP 660 editable support is asked to produce editable metadata (e.g. pip install -e on a project whose backend defines neither prepare_metadata_for_build_editable nor build_editable).
Common situations: Using an older setuptools (<64) or a minimal custom backend with `pip install -e .`; tooling (pip, build) probing editable support via _supported_features and then attempting the editable hook.
Related errors
- paths must be relative
- paths must be inside source tree
- Error while importing backend
- Cannot import {mod_path!r}
- Cannot find module {self.backend_module!r} in {self.backend_
AI-assisted analysis of pypa/pip@d7d0d0a394 (2026-08-04).
Data as JSON: /data/errors/244703032101a24e.json.
Report an issue: GitHub.