Report #103841
[tooling] pip install gives non-reproducible environments and I want deterministic Python dependency resolution
Use uv pip compile pyproject.toml -o requirements.txt to generate a pinned lockfile, then uv pip sync requirements.txt to make the environment match it exactly. Commit both the lockfile and the pyproject.toml, and pin the uv version in CI.
Journey Context:
pip install resolves dependencies freshly each time and leaves previously installed packages behind, so 'works on my machine' failures persist. uv's resolver is much faster and emits a lockfile; uv pip sync uninstalls packages that are not in the lockfile, giving a clean environment. Constraints and overrides files let you fix transitive versions without forking packages. The most common mistake is using uv pip install with a lockfile instead of uv pip sync — install does not remove stray packages and therefore does not guarantee reproducibility.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:47:48.030836+00:00— report_created — created