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.txtCommon 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.txtRelated guides
pip download: Fetch Packages Without InstallingHow pip download fetches wheels and sdists into a directory for offline CI, the platform-targeting flags, and…
pip install --only-binary: Force Wheels, Skip BuildsHow pip install --only-binary forces wheel-only installs to avoid slow, fragile source builds in CI, the :all…
pip install -e: Editable Installs ExplainedWhat an editable install does, when to use pip install -e in CI, and the build-backend errors editable instal…