gpt4 book ai didi

python - 通过 pip 安装 dlib 库时出错

转载 作者:太空宇宙 更新时间:2023-11-03 22:46:35 24 4
gpt4 key购买 nike

我不知道这有什么问题。我按照教程安装了 Dlib。

这是我遇到的两种方式和错误。我已经安装了其他已知的依赖项,如 cmake、gcc、openCV。从 dlib 的官方网站下载了 dlib 19.6。 Python 版本为 2.7。操作系统:Windows 10。

这是双向安装的 cmd 提示符的错误日志。

C:\dlib-19.6\dlib-19.6>python setup.py install
running install
running bdist_egg
running build
Detected Python architecture: 32bit
Detected platform: win32
Removing build directory C:\dlib-19.6\dlib-19.6\./tools/python/build
Configuring cmake ...
-- Building for: Visual Studio 14 2015
CMake Error in CMakeLists.txt:
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10-Sep-17 7:18:01 PM.
Project "C:\dlib-19.6\dlib-19.6\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\dlib-19.6\dlib-19.6\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj]
Done Building Project "C:\dlib-19.6\dlib-19.6\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\dlib-19.6\dlib-19.6\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" (default target) (1) ->
(Desktop_PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\dlib-19.6\dlib-19.6\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj]
error: cmake configuration failed!

C:\dlib-19.6\dlib-19.6>

通过 Python 包安装程序

C:\Users\Hp>pip install dlib
Collecting dlib
Using cached dlib-19.6.1.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\hp\\appdata\\local\\temp\\pip-build-vwayhd\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\hp\appdata\local\temp\tmp7vtii4pip-wheel- --python-tag cp27:
running bdist_wheel
running build
Detected Python architecture: 32bit
Detected platform: win32
Configuring cmake ...
-- Building for: Visual Studio 14 2015
CMake Error in CMakeLists.txt:
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10-Sep-17 7:28:49 PM.
Project "C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" (default target) (1) ->
(Desktop_PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.71
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Hp/AppData/Local/Temp/pip-build-vwayhd/dlib/tools/python/build/CMakeFiles/CMakeOutput.log".
error: cmake configuration failed!

----------------------------------------
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\hp\\appdata\\local\\temp\\pip-build-vwayhd\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\hp\appdata\local\temp\pip-7vl1fy-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
Detected Python architecture: 32bit
Detected platform: win32
Removing build directory c:\users\hp\appdata\local\temp\pip-build-vwayhd\dlib\./tools/python/build
Configuring cmake ...
-- Building for: Visual Studio 14 2015
CMake Error in CMakeLists.txt:
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10-Sep-17 7:28:52 PM.
Project "C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj" (default target) (1) ->
(Desktop_PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Hp\AppData\Local\Temp\pip-build-vwayhd\dlib\tools\python\build\CMakeFiles\3.9.0\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.73
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Hp/AppData/Local/Temp/pip-build-vwayhd/dlib/tools/python/build/CMakeFiles/CMakeOutput.log".
error: cmake configuration failed!

----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\hp\\appdata\\local\\temp\\pip-build-vwayhd\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\hp\appdata\local\temp\pip-7vl1fy-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\hp\appdata\local\temp\pip-build-vwayhd\dlib\

最佳答案

您的 PC 上未安装 Windows SDK。下载 Visual Studio 安装程序并安装 SDK。 enter image description here

关于python - 通过 pip 安装 dlib 库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46141597/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com