pip download: Fetch Distributions Command Reference
Download distributions without installing -- the basis for offline CI.
pip download resolves dependencies and downloads matching distributions into a directory without installing them. It is how air-gapped CI stages stage their packages.
Common flags / usage
- -d, --dest DIR -- download into DIR
- -r FILE -- download everything in a requirements file
- --only-binary=:all: -- download wheels only, never sdists
- --platform TAG -- target a different platform (requires wheels only)
- --python-version VER -- target a different Python (requires wheels only)
Example
shell
- run: |
pip download --only-binary=:all: \
--platform manylinux2014_x86_64 \
--python-version 312 \
-d ./wheels -r requirements.txtIn CI
When you pass --platform or --python-version, pip cannot build sdists, so add --only-binary=:all: and ensure every dependency publishes a matching wheel; otherwise the download fails fast.
Key takeaways
- pip download stages distributions into a directory without installing them.
- Cross-targeting platform/Python requires --only-binary=:all: (wheels only).
- Pair it with pip install --no-index --find-links for offline installs.
Related guides
pip wheel: Build a Wheelhouse Command ReferenceReference for pip wheel in CI: building .whl archives for a project and its dependencies into a wheelhouse, t…
pip install -r requirements.txt: Command ReferenceReference for pip install -r requirements.txt in CI: installing a whole dependency file, hashed installs, con…
pip cache: Manage the Wheel Cache Command ReferenceReference for pip cache in CI: inspecting and purging pip wheel and HTTP cache, finding the cache dir for cac…