pip "error: invalid command 'bdist_wheel'" in CI
setuptools reached the bdist_wheel command but it is provided by the separate wheel package, which is not installed in the build environment. Without it, setuptools cannot package the project as a wheel.
What this error means
The build fails with "error: invalid command 'bdist_wheel'" while running setup.py, typically in an isolated or stripped-down environment that has setuptools but not wheel.
pip
running bdist_wheel
error: invalid command 'bdist_wheel'Common causes
The wheel package is missing
bdist_wheel ships in the wheel distribution; if only setuptools is present, the command is unknown.
Build isolation is disabled without wheel installed
Using --no-build-isolation means pip does not provision a build env, so you must install wheel yourself first.
How to fix it
Install wheel before building
- Add
wheelto the environment that runs the build. - Re-run the build or install command.
Terminal
python -m pip install --upgrade pip setuptools wheelList wheel in build-system.requires
When using PEP 517 isolation, declare wheel so pip provisions it automatically.
pyproject.toml
[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"How to prevent it
- Always install
wheelalongside setuptools in build steps. - Declare build requirements in
pyproject.tomlfor isolated builds. - Avoid
--no-build-isolationunless you provision the build deps yourself.
Related guides
pip "error: metadata-generation-failed" in CIFix pip "error: metadata-generation-failed" in CI - the project build backend crashed while preparing package…
Python "setup.py egg_info" failed in CIFix "Command python setup.py egg_info failed with error code 1" in CI - pip could not collect project metadat…
pip "error: legacy-install-failure" in CIFix pip "error: legacy-install-failure" in CI - the fallback "setup.py install" path failed, usually because…