Skip to content
Latchkey

pip wheel: Build Wheels for Your Dependencies

Pre-build wheels so installs 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 later CI stages.

What it does

Builds wheels for the given requirements and all dependencies, writing .whl files to a directory. A later "pip install --no-index --find-links" step installs from that wheelhouse offline.

Common usage

Terminal
pip wheel -w ./wheelhouse -r requirements.txt
pip wheel -w ./wheelhouse .
pip install --no-index --find-links ./wheelhouse -r requirements.txt

Common CI error: missing build dependency

Building a wheel for an sdist needs the project’s build requirements. If a system header or compiler is missing, the build fails. Install the toolchain (or prefer prebuilt wheels) first.

Terminal
# Failure (example):
# error: command 'gcc' failed: No such file or directory

# Fix on Debian/Ubuntu runners:
apt-get update && apt-get install -y build-essential
pip wheel -w ./wheelhouse -r requirements.txt

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →