pip install -e . editable install error in CI
pip tried to install your project in editable mode but the build backend could not produce metadata - usually because pyproject.toml/setup.py is missing, malformed, or the package layout does not match the config.
What this error means
A pip install -e . step fails with "neither setup.py nor pyproject.toml found", a metadata-generation error, or "project does not have a build backend".
ERROR: file:///home/runner/work/app/app does not appear to be a Python project:
neither 'setup.py' nor 'pyproject.toml' found.Common causes
Wrong working directory or missing project files
The step runs pip install -e . from a directory that has no pyproject.toml or setup.py, so pip sees no project.
A build backend that cannot generate metadata
A misconfigured [build-system] or a setup.py that raises at import time stops the editable build before installation.
How to fix it
Install from the project root with a build backend
- Confirm the step runs where
pyproject.tomlorsetup.pylives. - Ensure
[build-system]declares a backend and required build deps. - Run the editable install from that directory.
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"Upgrade pip for PEP 660 editable support
Modern editable installs use PEP 660 hooks; an old pip may fail. Upgrade it first.
python -m pip install --upgrade pip
pip install -e .How to prevent it
- Keep a valid
[build-system]table inpyproject.toml. - Run editable installs from the project root in CI.
- Upgrade pip early so PEP 660 editable hooks are available.