News ·
If in doubt, delete the uv.lock file
Simon Willison shares a troubleshooting tip for Python 3.15: confusing dependency errors with uv are often caused by a leftover uv.lock file, and deleting it usually fixes the problem.
Simon Willison has hit occasional confusing Python dependency errors since upgrading to Python 3.15, and the rule he now follows is to delete the uv.lock file when in doubt. Deleting it and running uv run pytest again usually resolves the problem.
The cause: his projects are mostly libraries, which deliberately avoid committing a uv.lock file since locking versions would affect anything that depends on the library. However, running commands like uv run pytest leaves uv.lock files behind locally. These are listed in .gitignore so never get committed, but they can still pin a dependency version that does not yet have a Python 3.15 wheel, producing errors that are hard to trace back to the lock file.
For anyone building with AI tools or using uv in Python projects, this is a useful debugging shortcut: after a Python version upgrade, unexplained dependency failures may come from a stale, untracked lock file rather than a real incompatibility. Checking for and deleting uv.lock is a quick first step before digging deeper.
References
- Simon Willison · simonwillison.net
Read the full story at Simon Willison ↗Like, save or discuss on Buzz


