Skip to content
Latchkey

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.txt

In 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

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