# ModuleNotFoundError: No module named 'distutils'
  File ".../setuptools/_distutils/__init__.py", line 1, in <module>

- **ID:** `python/setuptools-no-module-named-distutils`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Python 3.12 removed the stdlib `distutils`. Older setuptools versions that rely on it break; also affects packages importing distutils directly.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.12 | active | — | — |
| 3.13 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   python -m pip install --upgrade 'setuptools>=68' wheel
python -m pip install <package>
   ```
2. **** (70% success)
   ```
   export SETUPTOOLS_USE_DISTUTILS=local
python -m pip install --upgrade setuptools
   ```

## Dead Ends

- **** — There is no installable `distutils` package on PyPI; it was a stdlib module. (95% fail)
- **** — If setuptools is already installed but old, pip may not upgrade it in the same invocation that fails. (60% fail)
