CMake must be installed to build the following extensions: dlib

本文详细介绍了在Python3环境下安装face_recognition库时遇到的错误:'CMakemustbeinstalledtobuildthefollowingextensions:dlib'。首先,文章指导读者通过pip3安装cmake来解决依赖问题,随后提供了安装face_recognition的具体命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

python3安装face_recognition时出现了错误CMake must be installed to build the following extensions: dlib

1、根据提示安装cmake

pip3 install cmake

2、安装face_recognition

pip3 install face_recognition

命令行运行:pip install dlib==19.24.0报错: Collecting dlib==19.24.0 Using cached dlib-19.24.0.tar.gz (3.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: dlib Building wheel for dlib (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for dlib (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] <string>:212: SyntaxWarning: invalid escape sequence '\(' <string>:213: SyntaxWarning: invalid escape sequence '\(' <string>:214: SyntaxWarning: invalid escape sequence '\(' <string>:194: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated. !! ******************************************************************************** Please remove any references to `setuptools.command.test` in all supported versions of the affected package. This deprecation is overdue, please update your project and remove deprecated calls to avoid build errors in the future. ******************************************************************************** !! C:\Users\徐庆凯\AppData\Local\Temp\pip-build-env-r6nhe5ov\overlay\Lib\site-packages\setuptools\_distutils\dist.py:289: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) running bdist_wheel running build running build_py running build_ext Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "D:\Users\徐庆凯\AppData\Local\Programs\Python\Python313\Scripts\cmake.exe\__main__.py", line 4, in <module> from cmake import cmake ModuleNotFoundError: No module named 'cmake' ERROR: CMake must be installed to build dlib [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for dlib Failed to build dlib ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib)
06-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值