# error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]

- **ID:** `python/pip-install-error-subprocess-exited-with-error`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pip is trying to build a package from source using the legacy setup.py egg_info path, and the build script fails — usually missing system build dependencies (compilers, headers), a broken setup.py, or incompatible setuptools version.

## Version Compatibility

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

## Workarounds

1. **** (82% success)
   ```
   pip install --only-binary=:all: <package>
# or force a wheel for a specific platform
pip install <package> --only-binary=:all: --platform manylinux2014_x86_64 --python-version 311 --implementation cp --abi cp311
   ```
2. **** (78% success)
   ```
   # Debian/Ubuntu
sudo apt-get install -y build-essential python3-dev libffi-dev
# macOS
xcode-select --install
# then
pip install --no-build-isolation <package>
   ```
3. **** (90% success)
   ```
   pip install -v <package> 2>&1 | tee pip.log
grep -A40 'error:' pip.log
   ```

## Dead Ends

- **** — Cache is not the cause; the build subprocess still fails identically because the underlying compiler/header issue remains. (85% fail)
- **** — Upgrading build tools helps only if the failure is due to outdated setuptools; missing C headers or a broken setup.py still fails. (60% fail)
