Skip to content
Latchkey

uv sync: Install Exactly What uv.lock Pins

Make the environment match the lockfile, exactly.

uv sync installs the dependencies pinned in uv.lock and removes anything not in it, producing a reproducible environment for a uv-managed project.

What it does

Resolves and installs from uv.lock so the environment matches it exactly, removing extraneous packages. It updates the lock first if pyproject.toml changed, unless you pass --frozen.

Common usage

Terminal
uv sync
uv sync --frozen
uv sync --no-dev
uv sync --extra docs

Common CI use: fail on stale lock

In CI you usually want --frozen so uv installs strictly from the committed lock and errors if it is out of date, rather than silently re-resolving.

Terminal
# Strict, reproducible CI install:
uv sync --frozen

Related guides

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