Skip to content
Latchkey

uv pip compile: Generate a Pinned requirements.txt

Compile loose requirements into a fully pinned lockfile.

uv pip compile resolves a high-level requirements file (or pyproject.toml) into a fully pinned requirements.txt - a fast, drop-in replacement for pip-tools’ pip-compile.

What it does

Reads input requirements and outputs an exhaustively pinned set, optionally with hashes. The output is a normal requirements.txt that pip or uv can install.

Common usage

Terminal
uv pip compile requirements.in -o requirements.txt
uv pip compile pyproject.toml -o requirements.txt
uv pip compile requirements.in --generate-hashes -o requirements.txt

Common CI use: pin then sync

Compile to a pinned file, then install it with uv pip sync (or pip install -r). --generate-hashes adds integrity hashes for a hardened, reproducible install.

Terminal
uv pip compile requirements.in --generate-hashes -o requirements.txt
uv pip sync requirements.txt

Related guides

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