# ERROR: File 'setup.py' not found for editable install of '<package>'. A setup.py or pyproject.toml is required.

- **ID:** `pip/editable-install-no-setup-py`
- **Domain:** pip
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The package being installed in editable mode (pip install -e .) lacks a setup.py, and the pyproject.toml does not define a valid build backend that supports editable installs (e.g., setuptools or hatchling with the build_editable hook).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| pip 21.3+ | active | — | — |
| Python 3.7-3.12 | active | — | — |

## Workarounds

1. **Add a pyproject.toml with a build backend that supports editable installs, e.g., using setuptools:
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"
Then run pip install -e . again.** (90% success)
   ```
   Add a pyproject.toml with a build backend that supports editable installs, e.g., using setuptools:
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"
Then run pip install -e . again.
   ```
2. **If the project uses a modern backend like hatchling, ensure pyproject.toml includes:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "<package>"
version = "0.1.0"
Then install with pip install -e .** (85% success)
   ```
   If the project uses a modern backend like hatchling, ensure pyproject.toml includes:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "<package>"
version = "0.1.0"
Then install with pip install -e .
   ```
3. **Use a symlink manually instead of editable install: ln -s /path/to/package /path/to/site-packages/<package> (Linux/macOS) or mklink /D (Windows). This bypasses pip's editable install mechanism.** (70% success)
   ```
   Use a symlink manually instead of editable install: ln -s /path/to/package /path/to/site-packages/<package> (Linux/macOS) or mklink /D (Windows). This bypasses pip's editable install mechanism.
   ```

## Dead Ends

- **** — Without proper package discovery configuration, the editable install will fail or install nothing. (70% fail)
- **** — This does not resolve the missing setup.py; it only disables build isolation. (85% fail)
- **** — Older pip versions may work but are insecure and lack modern features; not a sustainable fix. (60% fail)
