Dlib Python3.10编译安装

因为使用comfyui,有个插件要使用dlib,秋叶的安装包自动装不上。一直报错。

2024-07-17T14:16:55,755       raise CalledProcessError(retcode, cmd)
2024-07-17T14:16:55,755   subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
2024-07-17T14:16:55,771   ERROR: [present-rich] Building wheel for dlib (pyproject.toml) exited with 1
2024-07-17T14:16:55,771   [bold magenta]full command[/]: [blue]'D:\ComfyUI-aki-v1.3\python\python.exe' 'D:\ComfyUI-aki-v1.3\python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' build_wheel 'C:\Users\Administrator\AppData\Local\Temp\tmphxyp43vr'[/]
2024-07-17T14:16:55,771   [bold magenta]cwd[/]: C:\Users\Administrator\AppData\Local\Temp\pip-install-97ees6sp\dlib_e96e7fdc6f984cef9a87b71d78328140
2024-07-17T14:16:55,771   Building wheel for dlib (pyproject.toml): finished with status 'error'
2024-07-17T14:16:55,771   ERROR: Failed building wheel for dlib
2024-07-17T14:16:55,771 Failed to build dlib
2024-07-17T14:16:55,771 ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
2024-07-17T14:16:55,771 Exception information:
2024-07-17T14:16:55,771 Traceback (most recent call last):
2024-07-17T14:16:55,771   File "D:\ComfyUI-aki-v1.3\python\Lib\site-packages\pip\_internal\cli\base_command.py", line 160, in exc_logging_wrapper
2024-07-17T14:16:55,771     status = run_func(*args)
2024-07-17T14:16:55,771   File "D:\ComfyUI-aki-v1.3\python\Lib\site-packages\pip\_internal\cli\req_command.py", line 247, in wrapper
2024-07-17T14:16:55,771     return func(self, options, args)
2024-07-17T14:16:55,771   File "D:\ComfyUI-aki-v1.3\python\Lib\site-packages\pip\_internal\commands\install.py", line 477, in run
2024-07-17T14:16:55,771     raise InstallationError(
2024-07-17T14:16:55,771 pip._internal.exceptions.InstallationError: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
2024-07-17T14:16:55,793 Removed build tracker: 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-build-tracker-od94o43m'

Cmake

研究之后,大家让装Cmake,我按照教程,安装了cmake,添加了系统路径,依旧安装不上。

whl文件安装

然后从网站下载了现成的轮子,但是提示版本不符合。没有py3.10版本的

Links for dlib (pypi.org)

自己编译

没想到编译如此简单。

1、访问官网或者github,下载源码包http://dlib.net/,解压。

2、进入解压目录,按照官网的指示,进行编译。

cd examples
mkdir build
cd build
cmake ..
cmake --build . --config Release

3、安装。返回到dlib的解压包目录下(刚才进入了build子目录),执行以下脚本。

python setup.py install

成功安装。结束

  • 9
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值