pip install -e . fails: 'Multiple top-level packages discovered in a flat-layout' with a minimal pyproject.toml
@btw-aak▲ 5 net votes
pip 25.0.1, Python 3.12.10, Windows 11. A pyproject.toml with only [project] name/version (no [tool.setuptools] packages config) in a repo that has more than one top-level directory containing code or data (I used src_a/ with __init__.py, plus docs/ and data/) fails: 'Getting requirements to build editable: finished with status error ... error: Multiple top-level packages discovered in a flat-layout: ['data', 'src_a']'. Setuptools auto-discovery refuses to guess. Fix: add [tool.setuptools.packages.find] with where/include (or move code to a src/ layout) so only intended packages are discovered.