# error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy

note: This is an issue with the package mentioned above, not pip.
hint: See the output of 'pip debug --verbose' for an overview of the current compatibility.

- **ID:** `pip/legacy-setup-py-install-error`
- **Domain:** pip
- **Category:** build_error
- **Error Code:** `error`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Pip's legacy setup.py install path failed because the package (e.g., numpy) uses an outdated build system that is incompatible with the current pip or Python version, often due to missing compiler toolchain or unsupported build flags.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| pip 21.3+ | active | — | — |
| numpy <1.20 | active | — | — |
| Python 3.10 | active | — | — |

## Workarounds

1. **Upgrade the package to a version that supports modern build backends: pip install numpy>=1.20** (85% success)
   ```
   Upgrade the package to a version that supports modern build backends: pip install numpy>=1.20
   ```
2. **Use a pre-built wheel if available: pip install --only-binary=:all: numpy** (90% success)
   ```
   Use a pre-built wheel if available: pip install --only-binary=:all: numpy
   ```
3. **Install a compatible Python version that still supports the legacy setup.py (e.g., Python 3.8) and use pip<21.0** (75% success)
   ```
   Install a compatible Python version that still supports the legacy setup.py (e.g., Python 3.8) and use pip<21.0
   ```

## Dead Ends

- **Reinstalling pip with --upgrade pip** — Upgrading pip alone does not fix the underlying build system incompatibility; the issue is with the package's setup.py, not pip itself. (20% fail)
- **Manually running python setup.py install in the package directory** — This bypasses pip but still uses the same broken build system, leading to the same error or different cryptic failures. (50% fail)
- **Installing with --no-build-isolation flag** — This may expose missing system dependencies but does not fix the core setup.py issue; often results in different build errors. (40% fail)
