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

- **ID:** `python/setuptools-src-layout-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Setuptools auto-detection finds multiple directories that could be packages, causing ambiguity.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.7 | active | — | — |
| 3.8 | active | — | — |
| 3.9 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   setup(packages=['mypkg'], package_dir={'': 'src'})
   ```
2. **** (90% success)
   ```
   In setup.py: setup(package_dir={'': 'src'}, packages=find_packages('src'))
   ```

## Dead Ends

- **** — May not be the intended fix; setuptools may still detect src as a package. (50% fail)
- **** — Can cause import issues. (60% fail)
