# ERROR: Could not build wheels for foo, which is required to install pyproject.toml-based projects

- **ID:** `python/pip-legacy-install-failure-use-pep517`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The package declares a pyproject.toml with a build backend (e.g. setuptools.build_meta, hatchling) but the required build dependencies are not installed or the build backend fails during the wheel step.

## Version Compatibility

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

## Workarounds

1. **** (85% success)
   ```
   Install build dependencies explicitly then retry: python -m pip install --upgrade pip setuptools wheel && python -m pip install foo
   ```
2. **** (90% success)
   ```
   Inspect the failing build: python -m pip install -v foo and look for the actual backend traceback. Then install the missing backend (e.g. python -m pip install hatchling or flit-core) and retry.
   ```
3. **** (80% success)
   ```
   Build in isolation with build: python -m pip install build && python -m build --wheel --no-isolation . to reproduce the backend error locally with full logs.
   ```

## Dead Ends

- **** — Disables isolation but if the build backend is missing from the current env, the build still fails — often with a more confusing error. (60% fail)
- **** — The wheel package is not the build backend here; installing it does not supply the missing build requirement. (85% fail)
