pip install --only-binary: Force Wheels, Skip Builds
Refuse source builds so installs stay fast and don’t need a compiler.
The --only-binary flag makes pip install from wheels only, never building from source. It avoids slow C-extension builds and missing-compiler failures in CI.
What it does
Restricts pip to binary distributions (wheels) for the named packages, or all packages with :all:. If no compatible wheel exists, pip errors instead of building from sdist.
Common usage
Terminal
pip install --only-binary=:all: -r requirements.txt
pip install --only-binary=numpy,scipy numpy scipy
# Opposite: force a source build
pip install --no-binary=:all: somepkgCommon CI error: no wheel available
If a package has no wheel for the runner’s platform/Python, --only-binary=:all: fails fast. Either drop the restriction for that package or use a platform with published wheels.
Terminal
# Failure:
# ERROR: Could not find a version that satisfies the
# requirement somepkg (from versions: ...) [no wheels]
# Fix: allow source for just that package
pip install --only-binary=:all: --no-binary=somepkg -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 wheel: Build Wheels for Your DependenciesHow pip wheel builds wheel archives for a project and its dependencies, why CI uses it to pre-build a wheelho…
pip "No matching distribution found for X" in CIFix pip "ERROR: No matching distribution found for X" in CI - pip reached an index but found no release match…