# error: invalid command 'bdist_wheel'

- **ID:** `python/setup-py-invalid-command-bdist-wheel`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Building a wheel with `python setup.py bdist_wheel` or `pip install` from sdist requires the `wheel` package. It is missing from the build environment, so setuptools does not register the bdist_wheel command.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   python -m pip install --upgrade wheel setuptools
python setup.py bdist_wheel
# or build via pip which handles build deps:
python -m pip wheel . -w dist
   ```
2. **** (90% success)
   ```
   # pyproject.toml
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
# then
python -m build
   ```

## Dead Ends

- **** — Bypasses wheel building but is deprecated, pollutes the environment, and is not reproducible. Many modern packages refuse setup.py install. (80% fail)
- **** — Version mismatches and missing entry points cause later failures; setuptools may still not discover the command. (85% fail)
