# error: Multiple top-level packages discovered in a flat-layout: ['src', 'tests', 'docs'].

- **ID:** `python/pip-egg-info-directory-shadow`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

setuptools auto-discovery in a flat project layout finds multiple candidate top-level packages and refuses to guess which one is the distribution.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   cat > pyproject.toml <<'TOML'
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"

[project]
name = "mypkg"
version = "0.1.0"

[tool.setuptools.packages.find]
where = ["src"]
TOML
pip install .
   ```
2. **** (90% success)
   ```
   mkdir -p src/mypkg
mv mypkg/* src/mypkg/
# ensure pyproject.toml uses [tool.setuptools.packages.find] where=["src"]
pip install .
   ```

## Dead Ends

- **** — The error is from setuptools discovery, not isolation; the same 'Multiple top-level packages' error occurs. (85% fail)
- **** — Hides one symptom but src/ and docs/ still trigger the error; brittle workaround. (70% fail)
