跳到正文
Simon Willison·· 6 天前AI 评分15

If in doubt, delete the uv.lock file

If in doubt, delete the uv.lock file

AI 导读

切换到 Python 3.15 后,在使用 uv 运行 pytest 等命令时可能出现 Python 依赖错误。当 uv.lock 文件锁定了一个尚无 Python 3.15 wheel 的依赖版本时,会触发如 `error: Failed to build watchfiles==1.1.1` 的构建失败。删除 uv.lock 文件后重新运行 uv run pytest 通常可解决此问题。

来源:Simon Willison · simonwillison.net