# ModuleNotFoundError: No module named 'mypkg.data'
# after: pip install mypkg from sdist

- **ID:** `python/setuptools-sdist-missing-package-data`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Non-Python data files or subpackages were not included in the sdist because package_data/include_package_data or MANIFEST.in were misconfigured.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   [tool.setuptools.package-data]
mypkg = ["data/*.json", "data/*.csv"]
# or
[tool.setuptools]
include-package-data = true
   ```
2. **** (90% success)
   ```
   echo 'recursive-include mypkg/data *.json *.csv' >> MANIFEST.in
python -m build --sdist
pip install dist/mypkg-1.0.tar.gz
   ```

## Dead Ends

- **** — Forces building from sdist, which is exactly where the data files are missing. (90% fail)
- **** — Reinstall does not add missing files to the sdist. (85% fail)
- **** — .gitignore does not affect sdist contents; MANIFEST.in does. (80% fail)
