Skip to content
Latchkey

pip wheel: Build a Wheelhouse Command Reference

Pre-build wheels so later install stages are fast and offline-friendly.

pip wheel builds wheel archives (.whl) for requirements and their dependencies into a directory -- a "wheelhouse" you can install from quickly in a later CI stage.

Common flags / usage

  • -w, --wheel-dir DIR -- write built wheels to DIR
  • -r FILE -- build wheels for everything in a requirements file
  • . -- build a wheel for the current project
  • --no-deps -- build only the named project, not its dependencies

Example

shell
- run: pip wheel -w ./wheelhouse -r requirements.txt
- uses: actions/upload-artifact@v4
  with:
    name: wheelhouse
    path: wheelhouse/
# A later job installs offline from the wheelhouse:
- run: pip install --no-index --find-links ./wheelhouse -r requirements.txt

In CI

Building a wheel from an sdist needs the project build toolchain; a missing compiler fails with errors like "gcc: No such file or directory". Install build-essential on Debian/Ubuntu runners, or prefer prebuilt wheels.

Key takeaways

  • pip wheel produces .whl files for a project and all its dependencies.
  • Install from a wheelhouse with pip install --no-index --find-links for fast offline installs.
  • sdist builds need a compiler/toolchain on the runner.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →