# error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for foo

- **ID:** `python/setuptools-command-not-found-in-setup-py`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The `wheel` package is not installed in the build environment, so setuptools does not know the bdist_wheel command.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Install wheel into the build environment:
  pip install --upgrade setuptools wheel
  pip install foo
If using build isolation, ensure your pyproject.toml [build-system] requires includes 'wheel'.
   ```
2. **** (90% success)
   ```
   For legacy setup.py projects, add to pyproject.toml:
  [build-system]
  requires = ["setuptools>=61", "wheel"]
  build-backend = "setuptools.build_meta"
   ```

## Dead Ends

- **** — setuptools alone does not provide bdist_wheel; the wheel package is a separate distribution. (85% fail)
- **** — Forces source build, which still needs wheel to produce a wheel; same error. (80% fail)
