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 docsCommon 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 --frozenRelated guides
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…
uv run: Run a Command in the Project EnvHow uv run executes a command in the project environment, auto-syncing dependencies first, the --frozen flag…
poetry install: Install from the LockfileHow poetry install resolves and installs dependencies from poetry.lock, the --no-root and --only flags useful…