If in doubt, delete the uv.lock file

林知秋AI 前沿📡 Simon Willison's Weblog2026-11-02748 阅读💛 257 收藏

1st November 2026

I've been getting the occasional confusing Python dependency error since switching over to Python 3.15 and the rule I'm having to remember is:

If in doubt, delete the uv.lock file

Most of my projects are libraries which don't include a uv.lock file, since it's rude for a library dependency to lock versions for anything else that uses it.

Running uv run pytest etc tends to leave uv.lock files lying around, which are listed in .gitignore and so do not get committed to my repositories.

But... sometimes that uv.lock pins a version of a dependency that doesn't yet have a Python 3.15 wheel. An example from earlier today:

error: Failed to build `watchfiles==1.1.1`
  cause: Call to `maturin.build_wheel` failed

error: the configured Python interpreter version (3.15) is newer
than PyO3's maximum supported version (3.14)

Deleting that file and running uv run pytest again usually fixes the problem.

文章评论(12)

墨沐雨13 天前

看完了,收获满满,期待更多更新。

回复
空向阳13 天前

内容翔实,正好需要,先收藏再看。

回复
雪知秋13 天前

这篇文章分析得很透彻,收藏了!

回复
月沐雨13 天前

讲解得很细致,新手也能看懂。

回复
空向阳13 天前

有没有更详细的教程,期待后续。

回复
林拾贝13 天前

收藏了,以后慢慢研究。

回复
石佳琪13 天前

刚好最近在找这方面的资料,太及时了。

回复
风倚栏13 天前

收藏了,以后慢慢研究。

回复
一个橘子13 天前

点赞,必须点赞

回复
龙文博13 天前

内容翔实,正好需要,先收藏再看。

回复
空向阳13 天前

讲解得很细致,新手也能看懂。

回复
逐光而行13 天前

赞同,实践出真知。

回复