# ModuleNotFoundError: No module named 'setuptools._distutils.command.build_ext'

- **ID:** `python/setup-py-install-requires-not-found`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A partially-installed or downgraded setuptools leaves the vendored _distutils submodule missing, often after a failed upgrade or a conflicting distutils import.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   pip uninstall -y setuptools
pip install --no-cache-dir 'setuptools>=68'
python -c "from setuptools._distutils.command.build_ext import build_ext; print('ok')"
   ```
2. **** (90% success)
   ```
   python -m venv .venv && source .venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install .
   ```

## Dead Ends

- **** — No such package on PyPI; pip returns 'No matching distribution found'. (95% fail)
- **** — --no-deps can leave an inconsistent setuptools install if any dependency was previously removed. (70% fail)
