# ModuleNotFoundError: No module named 'mypkg.subpkg'

- **ID:** `python/setuptools-find-packages-missing-subpackage`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

setuptools.find_packages() did not include the subpackage because it lacks an __init__.py or was excluded by patterns.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   `touch mypkg/subpkg/__init__.py` then rebuild and reinstall the wheel.
   ```
2. **** (92% success)
   ```
   In setup.py: `from setuptools import find_namespace_packages` then `packages=find_namespace_packages(include=['mypkg*'])`.
   ```

## Dead Ends

- **** — install_requires lists external deps, not local packages. (95% fail)
- **** — Breaks on upgrade and hides the packaging bug. (70% fail)
