我在ComfuyUI-ROOP换脸插件使用当中,要求安装insightface ,但是我在安装insightface 过程当中,一直报错:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for insightface
Failed to build insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects
为解这个问题,整整花了一天半的时间才解决,现在分享出来。愿大家在这里在的路好走一点。
解决方案:
第一步:手动下载
"Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
并安装
安装时注意勾选:左上角的C++应用 和右下角的c++ATL
第二步:你还需要在Python 下面安装insightface
[SD-Launcher] F:\ComfyUI>python.exe -s -m pip install -U wheel (这是为安装insightface 做准备,因安装pyproject.toml-based 需要wheel )
[SD-Launcher] F:\ComfyUI>python.exe -s -m pip install -U coincurve (这是为安装insightface 做准备,因安装pyproject.toml-based 需要coincurve)
[SD-Launcher] F:\ComfyUI>python.exe -s -m pip install -U pyproject.toml(这是为安装insightface 做准备,insightface 的python-package 构建需要它)
[SD-Launcher] F:\ComfyUI>python.exe -s -m pip install onnxruntime-gpu (这是为安装insightface 做准备,insightface 的python-package 运行需要它)
[SD-Launcher] F:\ComfyUI>python.exe -s -m pip install onnxruntime (这是为安装insightface 做准备,insightface的python-package 运行需要它)
[SD-Launcher] F:\ComfyUI>python.exe -s -m pip install insightface (先拒绝访问,不能执行,后换用这个命令,正常执行) 推荐版本0.7.3
还是报那个错,接着继续
第三步:手工拷贝秋叶整合包python下面缺失的Include 和Lib 以及libs 三个目录
秋叶整合包的python没有libs/python311.lib这个头文件,当进行人脸相关人工智能程序时,需要大量include 一些Python库,而这些Python库放在标准的Python安装文件夹根目录下的Include 和Lib 以及libs 三个目录下。
所以需要把对应的Python版本下面的Include 与Lib以及libs三个目录下,在秋叶包里没有的文件全部都要拷贝到秋叶的安装包下面。
方法就是:1)首先下载标准版Python
https://www.python.org/ftp/python/3.11.6/python-3.11.6-amd64.exe
人工安装到一个指定的好找的文件夹下,
2)把对应的Python版本下面的Include 与Lib以及libs 两上目录下,在秋叶包里没有的文件全部都要拷贝到秋叶的安装包下面。
3)重点检查,你拷贝好以后,有没有libs/python311.lib 存在,具休是什么什么版本号,要看你用的是秋叶整合包里的python版本号决定。一定要有libs/python311.lib
如上面不严格执行,很有可能会在装insightface ,报错:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for insightface
Failed to build insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects