# error: Each package must have an __init__.py file in its directory

- **ID:** `python/setuptools-package-init-missing`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Setuptools requires __init__.py for package discovery in older versions or certain configurations.

## Version Compatibility

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

## Workarounds

1. **Create __init__.py in every package directory** (95% success)
   ```
   find . -type d -name 'mypackage' -exec touch {}/__init__.py \;
   ```
2. **Use find_packages with exclude or namespace packages** (90% success)
   ```
   from setuptools import find_packages
setup(packages=find_packages(include=['mypackage*']))
   ```

## Dead Ends

- **Adding empty __init__.py to root only** — Each subpackage directory needs its own __init__.py. (80% fail)
- **Removing the package from setup.py** — Excludes package from distribution; not a fix. (60% fail)
