You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacOS安装Stable Diffusion WebUI时basicsr安装OSError报错求助

macOS下Stable Diffusion WebUI安装报错(basicsr目录非空)解决方法

问题详情

运行./web-ui.sh脚本时触发以下错误:

OSError: [Errno 66] Directory not empty: '/private/var/folders/8h/x8kgqp2x2h3gryh9v7v9f8r00000gp/T/pip-install-r5hyfavd/basicsr_ec8eabc4b9e0466487ec10fcf881f174/.eggs/Cython-3.0.5-py3.10-macosx-10.9-universal2.egg/Cython-3.0.5.dist-info' -> '/private/var/folders/8h/x8kgqp2x2h3gryh9v7v9f8r00000gp/T/pip-install-r5hyfavd/basicsr_ec8eabc4b9e0466487ec10fcf881f174/.eggs/Cython-3.0.5-py3.10-macosx-10.9-universal2.egg/EGG-INFO'

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: legacy-install-failure

× Encountered error while trying to install package.

╰─> basicsr

note: This is an issue with the package mentioned above, not pip.

hint: See above for output from the failure.

[notice] A new release of pip available: 22.2.2 -> 23.3.1

[notice] To update, run: pip install --upgrade pip

原因说明:这是pip安装basicsr时的临时目录冲突问题——系统尝试将Cython-3.0.5.dist-info重命名为EGG-INFO,但目标目录已存在且非空,并非basicsr包本身的问题。


解决步骤

1. 升级pip

先按照提示升级pip到最新版本,避免版本兼容问题:

# 如果使用了WebUI的虚拟环境,先激活
cd /你的WebUI目录路径
source venv/bin/activate

# 升级pip
pip install --upgrade pip

2. 清理缓存与残留文件

清除pip缓存

pip cache purge

删除报错中的临时安装目录

直接删除报错里指定的临时目录:

rm -rf /private/var/folders/8h/x8kgqp2x2h3gryh9v7v9f8r00000gp/T/pip-install-r5hyfavd/

如果找不到对应路径,也可以先查看pip临时目录位置:

pip install --help | grep -A 1 "temp-dir"

再用rm -rf命令删除该目录。

3. 重新运行安装脚本

回到WebUI目录,重新执行安装脚本:

cd /你的WebUI目录路径
./web-ui.sh

4. 备选:手动安装basicsr

如果上述步骤无效,尝试手动安装basicsr:

# 激活虚拟环境(若使用)
source venv/bin/activate

# 无缓存安装basicsr
pip install basicsr --no-cache-dir

安装完成后再运行./web-ui.sh。


内容的提问来源于stack exchange,提问作者n_v_e_younes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 15:03:19