已安装CMake仍遭遇DLIB安装失败问题求助
Windows 10下源码安装dlib失败:未找到Windows SDK版本10.0.17763.0
各位大佬好,我在Windows 10系统上尝试安装dlib(版本19.23.0)时遇到了瓶颈,折腾了好几天都没解决,恳请帮忙看看问题出在哪:
我的环境配置
- 操作系统:Windows 10 22000版本
- Python版本:3.10.2(使用独立虚拟环境,未使用Anaconda)
- 已安装工具:Visual Studio Build Tools 2019、CMake,且多次确认环境变量配置无误
已尝试的操作
- 从dlib官方源码包下载19.23.0版本,执行
python setup.py install命令安装 - 反复检查CMake、VS Build Tools的环境变量是否正常加载
- 查阅过相关技术讨论帖,但没找到匹配的解决方案
详细错误日志
安装过程中,CMake一直报错找不到Windows SDK 10.0.17763.0,完整错误输出如下:
C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install已被弃用,请使用build、pip及其他标准工具。 warnings.warn( C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\easy_install.py:160: EasyInstallDeprecationWarning: easy_install命令已被弃用,请使用build、pip及其他标准工具。 warnings.warn( running bdist_egg running egg_info writing tools/python\dlib.egg-info\PKG-INFO writing dependency_links to tools/python\dlib.egg-info\dependency_links.txt writing top-level names to tools/python\dlib.egg-info\top_level.txt package init file 'tools\python\dlib\__init__.py' not found (or not a regular file) reading manifest file 'tools/python\dlib.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'tools\python\build*' no previously-included directories found matching 'dlib\cmake_utils\*\build*' no previously-included directories found matching 'dlib\test' warning: no previously-included files matching '*.pyc' found anywhere in distribution writing manifest file 'tools/python\dlib.egg-info\SOURCES.txt' installing library code to build\bdist.win-amd64\egg running install_lib running build_py running build_ext C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py:129: DeprecationWarning: distutils版本类已被弃用,请改用packaging.version。 if LooseVersion(cmake_version) < '3.1.0': Building extension for Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] Invoking CMake setup: 'cmake C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\asus\PycharmProjects\drowsiness-detection\envt\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib.win-amd64-3.10 -A x64' -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.22000. CMake Error at CMakeLists.txt:14 (project): Failed to run MSBuild command: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe to get the value of VCTargetsPath: Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved. Build started 27-Feb-22 6:58:45 PM. Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" on node 1 (default targets). C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: 未找到Windows SDK版本10.0.17763.0。请安装所需版本的Windows SDK,或在项目属性页中更改SDK版本,或右键单击解决方案并选择"重新定向解决方案"。 [C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj] Done Building Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default targets) -- FAILED. Build FAILED. "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default target) (1) -> (_CheckWindowsSDKInstalled target) -> C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: 未找到Windows SDK版本10.0.17763.0。请安装所需版本的Windows SDK,或在项目属性页中更改SDK版本,或右键单击解决方案并选择"重新定向解决方案"。 [C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.21 Exit code: 1 -- Configuring incomplete, errors occurred! See also "C:/Users/asus/Downloads/dlib-19.23.0/dlib-19.23.0/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeOutput.log". Traceback (most recent call last): File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 222, in <module> setup( File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\__init__.py", line 155, in setup return distutils.core.setup(**attrs) File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup return run_commands(dist) File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands dist.run_commands() File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands self.run_command(cmd) File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command cmd_obj.run() File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 74, in run self.do_egg_install() File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 116, in do_egg_install self.run_command('bdist_egg') File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 171, in build_extension subprocess.check_call(cmake_setup, cwd=build_folder) File "C:\Users\asus\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\asus\\PycharmProjects\\drowsiness-detection\\envt\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
我检查过VS Build Tools的SDK安装列表,没找到10.0.17763.0这个版本,而且我的系统是Windows 10 22000,有没有办法让CMake自动适配我已有的SDK版本?或者还有其他解决思路吗?麻烦各位指点一下,谢谢!
内容的提问来源于stack exchange,提问作者Astrian_72954
相关产品推荐
相关产品推荐

