Windows下uv环境硬链接失败问题

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, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.

原因:uv 的缓存目录与你的目标安装目录(虚拟环境)不在同一个文件系统 / 磁盘分区(比如缓存在 C 盘,项目 / 虚拟环境在 E 盘),而操作系统不允许跨文件系统创建硬链接(hardlink),所以 uv 只能退而求其次用「完整文件复制」,并弹出性能警告。

1.清除之前的缓存

一般缓存会存在C盘目录下,如下,会占据大量空间

也可命令行查看

uv.exe cache dir

相关命令

clean Clear the cache, removing all entries or those linked to specific packages

prune Prune all unreachable objects from the cache

dir Show the cache directory

size Show the cache size

使用命令删除缓存

uv cache clean

2.修改 uv 缓存目录到 其它盘

  • 打开「系统属性→高级→环境变量」
  • 新建用户变量:变量名 UV_CACHE_DIR,变量值 E:\.uv\cache(或其他 E 盘路径)
  • 重启终端后生效

硬链接问题解决

相关推荐
Akiyama_Mio-Kon20 小时前
2026 最新:Dify 本地 Docker 部署完整教程(Windows + Git Bash)
windows·git·docker
霸道流氓气质20 小时前
Spring AI 输出解析器进阶
人工智能·windows·spring
黄一一9112431 天前
跨平台视频图片压缩互转!离线视频压缩工具!Github开源轻松无损压缩视频!Win/Mac/Linux三端通用开源工具
windows·macos·音视频·开源软件
池塘游鱼1 天前
VMware虚拟机安装Windows 10系统 超详细图文教程
windows·vmware
易点云徐源1 天前
(已解决)BOSS直聘 Windows 客户端一直“加载中,请稍候”怎么办?
windows
绮罗郁金香1 天前
windows延迟更新
windows
苏生Susheng1 天前
【软件实施】Windows 服务器运维实战
java·运维·服务器·windows·spring boot·javaweb·实施
方向研究1 天前
UEFI/Windows启动流程
windows
ZnS_oscar1 天前
不用下载字体,获得仿宋字体
windows·word
霸道流氓气质1 天前
通义千问 Chat 模型高级用法:Function Calling / Structured Output / 多轮对话
linux·运维·windows