UV 设置环境变量解决Failed to hardlink files警告
因为conda的协议变化,我也逐步开始使用uv做python包管理,效率很高,效果很好。但最近认真看了uv add的提示,当uv的缓存区(我的是Windows系统,默认放在文件夹下)和我们的python项目在不同分区时,会出现提示,警告说这么搞可能会降低性能。or use。
·
问题出现
因为conda的协议变化,我也逐步开始使用uv做python包管理,效率很高,效果很好。但最近认真看了uv add的提示,当uv的缓存区(我的是Windows系统,默认放在C:\Users\yeshe\AppData\Local\uv\cache文件夹下)和我们的python项目在不同分区时,会出现Failed to hardlink files提示,警告说这么搞可能会降低性能。
warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
If the cache and target directories are on different filesystems, hardlinking may not be supported.
If this is intentional, setexport UV_LINK_MODE=copyor use--link-mode=copyto suppress this warning.
问题解决
根据参考资料,设置UV_CACHE_DIR环境变量,在我们常放代码的分区放置这些缓存文件,问题得以解决。
新装的包也不报警告了:
参考资料
更多推荐

所有评论(0)