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.txtCommon 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.txtRelated guides
uv pip install: Fast, pip-Compatible InstallsHow uv pip install provides a fast, drop-in pip-compatible installer, the flags it shares with pip, and the m…
uv lock: Resolve and Write uv.lockHow uv lock resolves the project’s dependencies into uv.lock, the --check flag for CI gates, and the upgrade…
pip install -r: Install from requirements.txt in CIHow pip install -r installs every dependency from a requirements file, the flags that make it reproducible in…