我在我的笔记本电脑上安装 dlib 时遇到问题。 我需要 dlib 来使用face_recognition python 包。 我正在使用 Visual Studio 2022 社区。
所以我之前安装过dlib并且知道如何安装它。我知道你应该下载 Visual Studio 并安装它的 C++ 部分,并使用 pip 安装 cmake。一年前我在我的笔记本电脑上用 python 3.6 和 python 3.9 做过这个。
几天前,我想在 python 3.8 上安装它,但我不断收到以下错误。所以我教的python版本与此有关。我可以使用我大学的电脑。我能够在我的大学计算机上的 python 3.10.somehting 上安装 dlib 并且运行良好,所以然后我在我的笔记本电脑上安装了相同的 python 版本,但它不起作用(相同的错误)。
因此我得出的结论是它不是 python 版本,问题出在我的笔记本电脑上。该错误表明 cl.exe 无法运行示例程序,因此我认为 Visual Studio 可能存在问题。我多次安装和卸载 Visual Studio(3 到 4 次),但一直收到相同的错误。
我还观察到,当我在一年前使用的 2 个版本(3.9 和 3.6)的 python 上卸载并重新安装 dlib 时,它能够正确安装它而不会出现错误。
我在这上面花了近 8 个小时,这真是太令人沮丧了!如果有人能给我建议,告诉我在我的情况下可以做什么,我将非常感激。
如果问题描述太长请告诉我
是否有可能是我安装的其他应用程序导致了此问题?
C:\Users\Kharghuvel>pip install dlib
Collecting dlib
Using cached dlib-19.24.2.tar.gz (11.8 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
╰─> [132 lines of output]
running bdist_wheel
running build
running build_ext
<string>:125: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
Building extension for Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\lib.win-amd64-cpython-310 -DPYTHON_EXECUTABLE=C:\Users\Kharghuvel\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\lib.win-amd64-cpython-310 -A x64'
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.36.32537.0
-- The CXX compiler identification is MSVC 19.36.32537.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: E:/Visual Studio community 2022/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: E:/Visual Studio community 2022/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Users/Kharghuvel/AppData/Local/Temp/pip-build-env-t79xzg2d/overlay/Lib/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"E:/Visual Studio community 2022/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Kharghuvel/AppData/Local/Temp/pip-install-u47nsqdb/dlib_54426e676ce04cd8be1cffdfb8367a63/build/temp.win-amd64-cpython-310/Release/CMakeFiles/CMakeScratch/TryCompile-9mnlfb
Run Build Command(s):E:/Visual Studio community 2022/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_27432.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n && MSBuild version 17.6.3+07e294721 for .NET Framework
Build started 7/17/2023 9:21:57 PM.
Project "C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTC_27432.dir\Debug\".
Creating directory "C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\Debug\".
Creating directory "cmTC_27432.dir\Debug\cmTC_27432.tlog\".
InitializeBuildStatus:
Creating "cmTC_27432.dir\Debug\cmTC_27432.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
E:\Visual Studio community 2022\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64\CL.exe /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_27432.dir\Debug\\" /Fd"cmTC_27432.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\testCCompiler.c"
Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32537 for x64
testCCompiler.c
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_27432.dir\Debug\\" /Fd"cmTC_27432.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\testCCompiler.c"
Link:
E:\Visual Studio community 2022\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\Debug\cmTC_27432.exe" /INCREMENTAL /ILK:"cmTC_27432.dir\Debug\cmTC_27432.ilk" /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:/Users/Kharghuvel/AppData/Local/Temp/pip-install-u47nsqdb/dlib_54426e676ce04cd8be1cffdfb8367a63/build/temp.win-amd64-cpython-310/Release/CMakeFiles/CMakeScratch/TryCompile-9mnlfb/Debug/cmTC_27432.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/Kharghuvel/AppData/Local/Temp/pip-install-u47nsqdb/dlib_54426e676ce04cd8be1cffdfb8367a63/build/temp.win-amd64-cpython-310/Release/CMakeFiles/CMakeScratch/TryCompile-9mnlfb/Debug/cmTC_27432.lib" /MACHINE:X64 /machine:x64 cmTC_27432.dir\Debug\testCCompiler.obj
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: The specified task executable "link.exe" could not be run. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.dir\Debug\cmTC_27432.tlog'. [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.FileSystemEnumerableIterator`1.CommonInit() [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.Directory.GetFiles(String path, String searchPattern) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.CPPTasks.TrackedVCToolTask.PostExecuteTool(Int32 exitCode) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.Execute() [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
Done Building Project "C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj" (default target) (1) ->
(Link target) ->
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: The specified task executable "link.exe" could not be run. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.dir\Debug\cmTC_27432.tlog'. [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.FileSystemEnumerableIterator`1.CommonInit() [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at System.IO.Directory.GetFiles(String path, String searchPattern) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.CPPTasks.TrackedVCToolTask.PostExecuteTool(Int32 exitCode) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
E:\Visual Studio community 2022\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1127,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.Execute() [C:\Users\Kharghuvel\AppData\Local\Temp\pip-install-u47nsqdb\dlib_54426e676ce04cd8be1cffdfb8367a63\build\temp.win-amd64-cpython-310\Release\CMakeFiles\CMakeScratch\TryCompile-9mnlfb\cmTC_27432.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.89
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:14 (project)
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "C:\Users\Kharghuvel\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\Kharghuvel\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\Kharghuvel\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\build_meta.py", line 416, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\build_meta.py", line 401, in _build_with_temp_dir
self.run_setup()
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 218, in <module>
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 343, in run
self.run_command("build")
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
self.run_command(cmd_name)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\Kharghuvel\AppData\Local\Temp\pip-build-env-t79xzg2d\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "<string>", line 130, in run
File "<string>", line 167, in build_extension
File "C:\Users\Kharghuvel\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Kharghuvel\\AppData\\Local\\Temp\\pip-install-u47nsqdb\\dlib_54426e676ce04cd8be1cffdfb8367a63\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Kharghuvel\\AppData\\Local\\Temp\\pip-install-u47nsqdb\\dlib_54426e676ce04cd8be1cffdfb8367a63\\build\\lib.win-amd64-cpython-310', '-DPYTHON_EXECUTABLE=C:\\Users\\Kharghuvel\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Kharghuvel\\AppData\\Local\\Temp\\pip-install-u47nsqdb\\dlib_54426e676ce04cd8be1cffdfb8367a63\\build\\lib.win-amd64-cpython-310', '-A', 'x64']' returned non-zero exit status 1.
[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: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
我也有类似的错误。搜索了一下,看起来是由于构建路径太长造成的。
对我有用的是将环境变量 TMP 和 TEMP 设置为 c: mp
这使得 pip 使用 c:mp 作为临时文件的根文件夹。默认是 C:/Users/