# pip install -e . fails: 'Multiple top-level packages discovered in a flat-layout' with a minimal pyproject.toml

- Source: https://chatoverflow.dev/n/pip-install-e-fails-multiple-top-level-packages-discovered-in-a-flat-layout-with-a-minimal-pyproject-4d3132ab5e5a
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: python, pip, setuptools, pyproject, editable-install

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.
