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 盘路径)
  • 重启终端后生效

硬链接问题解决

相关推荐
unsynchronized3 小时前
OpenClaw 安装指南:Linux 与 Windows 系统详细教程
linux·运维·windows·ai
x***r1514 小时前
R语言 4.5.1安装教程 Windows版:解压+管理员运行+自定义路径+启动验证指南
windows
非凡ghost6 小时前
Zen Browser:基于 Firefox 的极简开源浏览器,隐私与速度兼得
前端·网络·windows·学习·开源·firefox·软件需求
木梓辛铭6 小时前
windows下部署openclaw详细方法及错误处理办法
windows·学习方法·持续部署
John_ToDebug6 小时前
死锁案例:UI 线程阻塞等待跨进程 COM 注入
c++·windows·笔记
oscar9998 小时前
Memurai:Redis官方认可的Windows原生解决方案
数据库·windows·redis
暖阳常伴10 小时前
Windows安装MongoDB
数据库·windows·mongodb
星辰引路-Lefan10 小时前
全平台 Docker 部署 CPA(CLIProxyAPI Plus) 灵活定制指南 (Linux/Windows)——接入Codex
linux·windows·docker·ai·ai编程
YQ_0112 小时前
Windows + Ubuntu 双系统安装:不使用 GRUB,直接在开机时选择系统
linux·windows·ubuntu