首页 新闻 会员 周边 捐助

安装dlib报错

0
悬赏园豆:40 [待解决问题]

我在安装dlib的时候报错,具体如下,求助大佬如何解决?各种ai我都已经问过了

(py39) C:\Users\Administrator>pip install dlib19.22.0
Looking in indexes: https://repo.huaweicloud.com/repository/pypi/simple/
Collecting dlib
19.22.0
Using cached https://repo.huaweicloud.com/repository/pypi/packages/11/93/ec41d6ef7e769977aa08e49441c52276da27859f12dcbf1c6deb96ce5e9f/dlib-19.22.0.tar.gz (7.4 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [76 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
C:\Users\Administrator\AppData\Local\Temp\pip-install-pcyde4_8\dlib_4d9ceab6d1244d8da8c377a7737a2a29\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.9.19 (main, Mar 21 2024, 17:21:27) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pip-install-pcyde4_8\dlib_4d9ceab6d1244d8da8c377a7737a2a29\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-pcyde4_8\dlib_4d9ceab6d1244d8da8c377a7737a2a29\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=D:\Users\Administrator\anaconda3\envs\py39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-pcyde4_8\dlib_4d9ceab6d1244d8da8c377a7737a2a29\build\lib.win-amd64-cpython-39 -A x64'
-- Building for: NMake Makefiles
CMake Deprecation Warning at CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:5 (message):



    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


    You must use Visual Studio to build a python extension on windows.  If you
    are getting this error it means you have not installed Visual C++.  Note
    that there are many flavors of Visual Studio, like Visual Studio for C#
    development.  You need to install Visual Studio for C++.


    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!




  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-pcyde4_8\dlib_4d9ceab6d1244d8da8c377a7737a2a29\setup.py", line 222, in <module>
      setup(
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\wheel\bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
      self.run_command(cmd_name)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-pcyde4_8\dlib_4d9ceab6d1244d8da8c377a7737a2a29\setup.py", line 134, in run
      self.build_extension(ext)
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-pcyde4_8\dlib_4d9ceab6d1244d8da8c377a7737a2a29\setup.py", line 171, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\subprocess.py", line 373, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-pcyde4_8\\dlib_4d9ceab6d1244d8da8c377a7737a2a29\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-pcyde4_8\\dlib_4d9ceab6d1244d8da8c377a7737a2a29\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=D:\\Users\\Administrator\\anaconda3\\envs\\py39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-pcyde4_8\\dlib_4d9ceab6d1244d8da8c377a7737a2a29\\build\\lib.win-amd64-cpython-39', '-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
Running setup.py clean for dlib
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects

wendy_ann的主页 wendy_ann | 初学一级 | 园豆:74
提问于:2024-04-15 00:26
< >
分享
所有回答(2)
0

错误里有说,要安装VC编译环境
You need to install Visual Studio for C++

www378660084 | 园豆:1143 (小虾三级) | 2024-04-15 10:49

我安装了visual studio2019,请问是这个吗?我安装完之后会有中文乱码的报错😭并且也有下面的报错note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects请问大佬我是哪里弄错了吗?😭😭

支持(0) 反对(0) wendy_ann | 园豆:74 (初学一级) | 2024-04-15 10:52

@wendy_ann: You need to install Visual Studio for C++,安了vs要把C++的编译环境选上,看看你装了没有

支持(0) 反对(0) www378660084 | 园豆:1143 (小虾三级) | 2024-04-16 10:40

@www378660084: 我又重新安装了visual studio 2022,安装的时候把带有C++的选项都选上了,但是还是报错,
(py39) PS D:\Users\Administrator\PycharmProjects\convex_optimizer\DragonDiffusion-master> pip install dlib19.22.0
Looking in indexes: https://repo.huaweicloud.com/repository/pypi/simple/
Collecting dlib
19.22.0
Using cached https://repo.huaweicloud.com/repository/pypi/packages/11/93/ec41d6ef7e769977aa08e49441c52276da27859f12dcbf1c6deb96ce5e9f/dlib-19.22.0.tar.gz (7.4 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [144 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.9.19 (main, Mar 21 2024, 17:21:27) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\tools\python -DCMAKE_LIBRARY_OUTP
UT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=D:\U
sers\Administrator\anaconda3\envs\py39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39 -A x64'
-- Building for: Visual Studio 17 2022
CMake Deprecation Warning at CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
  -- The C compiler identification is MSVC 19.39.33523.0
  -- The CXX compiler identification is MSVC 19.39.33523.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe
  -- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - broken
  CMake Error at D:/Users/Administrator/anaconda3/envs/py39/Lib/site-packages/cmake/data/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):
    The C compiler

      "D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: 'C:/Users/Administrator/AppData/Local/Temp/pip-install-vjhfc5td/dlib_f08599fbb4d3418b9e9a84b13702f7a5/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeScratch/TryCompile-nsyc6f'

      Run Build Command(s): "D:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_6cf47.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n
      閫傜敤浜\x8e .NET Framework MSBuild 鐗堟湰 17.9.8+b34f75857
      鐢熸垚鍚\xaf鍔ㄦ椂闂翠负 2024/4/17 14:23:54銆\x82

      鑺傜偣 1 涓婄殑椤圭洰鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87)銆\x82
      PrepareForBuild:
        姝e湪鍒涘缓鐩\xae褰曗\x80渃mTC_6cf47.dir\Debug\鈥濄\x80\x82
      D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭 

鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑虹幇闂\xae棰樸\x80\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
宸插惎鐢ㄧ粨鏋勫寲杈撳嚭銆傜紪璇戝櫒璇婃柇鐨勬牸寮忚\xae剧疆灏嗗弽鏄犻敊璇\xaf灞傛\xac$粨鏋勩\x80傛湁鍏宠\xaf︾粏淇℃伅锛岃\xaf峰弬闃\x85 https://aka.ms/cpp/structured-output銆\x82
姝e湪鍒涘缓鐩\xae褰曗\x80淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\Debug\鈥濄\x80\x82
姝e湪鍒涘缓鐩\xae褰曗\x80渃mTC_6cf47.dir\Debug\cmTC_6cf47.tlog\鈥濄\x80\x82
InitializeBuildStatus:
姝e湪鍒涘缓鈥渃mTC_6cf47.dir\Debug\cmTC_6cf47.tlog\unsuccessfulbuild鈥濓紝鍥犱负宸叉寚瀹氣\x80淎lwaysCreate鈥濄\x80\x82
姝e湪瀵光\x80渃mTC_6cf47.dir\Debug\cmTC_6cf47.tlog\unsuccessfulbuild鈥濇墽琛\x8c Touch 浠诲姟銆\x82
ClCompile:
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\CL.exe /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBC
S /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR="Debug"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_6cf47.dir\Debug\" /Fd"cmTC_6cf47.dir\Deb
ug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\testCCompiler.c"
鐢ㄤ簬 x64 鐨\x84 Microsoft (R) C/C++ 浼樺寲缂栬瘧鍣\xa8 19.39.33523 鐗\x88
鐗堟潈鎵\x80鏈\x89(C) Microsoft Corporation銆備繚鐣欐墍鏈夋潈鍒┿\x80\x82
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:for
Scope /Zc:inline /Fo"cmTC_6cf47.dir\Debug\" /Fd"cmTC_6cf47.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\testCCompiler.c"
testCCompiler.c
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鎸囧畾鐨勪换鍔″彲鎵ц\xa1屾
浠垛\x80淐L.exe鈥濇湭鑳借繍琛屻\x80係ystem.IO.DirectoryNotFoundException: 鏈\xaa鑳芥壘鍒拌矾寰勨\x80淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dli i
b_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.dir\Debug\cmTC_6cf47.tlog鈥濈殑涓\x80閮ㄥ
銆\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeSc cratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.__Erro
r.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy
stemEnumerableIterator1.CommonInit() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj] D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy stemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkH
ost) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.Direct
ory.GetFiles(String path, String searchPattern) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.PostExecuteTool(Int32 exitCode) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.ToolTask.Execute() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
宸插畬鎴愮敓鎴愰」鐩\xae鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87)鐨勬搷浣\x9c - 澶辫触銆\x82

      鐢熸垚澶辫触銆\x82

      鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87) (1) ->
      (PrepareForBuild 鐩\xae鏍\x87) ->
        D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳 

嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑虹幇闂\xae棰樸\x80\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]

      鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87) (1) ->
      (ClCompile 鐩\xae鏍\x87) ->
        D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鎸囧畾鐨勪换鍔″彲鎵ц\xa1

屾枃浠垛\x80淐L.exe鈥濇湭鑳借繍琛屻\x80係ystem.IO.DirectoryNotFoundException: 鏈\xaa鑳芥壘鍒拌矾寰勨\x80淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\d
lib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.dir\Debug\cmTC_6cf47.tlog鈥濈殑涓\x80閮
垎銆\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMake eScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.__Erro
r.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy
stemEnumerableIterator1.CommonInit() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj] D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy stemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkH
ost) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.Direct
ory.GetFiles(String path, String searchPattern) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.PostExecuteTool(Int32 exitCode) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.ToolTask.Execute() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]

          1 涓\xaa璀﹀憡
          1 涓\xaa閿欒\xaf\xaf

      宸茬敤鏃堕棿 00:00:01.28





    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 "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py", line 222, in <module>
      setup(
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\wheel\bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
      self.run_command(cmd_name)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py", line 134, in run
      self.build_extension(ext)
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py", line 171, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\subprocess.py", line 373, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-vjhfc5td\\dlib_f08599fbb4d3418b9e9a84b13702f7a5\\too

ls\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=D:\Users\Administrator\anaconda3\envs\py39\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39', '-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
Running setup.py clean for dlib
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects

请问这个应该如何解决呀?

支持(0) 反对(0) wendy_ann | 园豆:74 (初学一级) | 2024-04-17 14:31
0

这个错误信息表明,在构建 dlib 的过程中,出现了一些问题。主要的错误提示是:

css

You must use Visual Studio to build a python extension on windows.
这意味着在 Windows 上构建 Python 扩展时,需要使用 Visual Studio。根据错误信息,你没有安装 Visual C++,而在 Windows 上构建 Python 扩展需要它。

解决方法:

安装 Visual Studio: 在 Windows 上安装 Visual Studio,并确保包含了 C++ 的开发组件。你可以在Visual Studio 官网下载安装。

安装 C++ 开发工具: 在 Visual Studio 安装过程中,确保选择了 C++ 的开发工具。

重新安装 dlib: 安装完成 Visual Studio 后,重新运行 pip install dlib,应该就能够成功安装了。

如果你已经安装了 Visual Studio 但问题仍然存在,可能是需要更新 Visual Studio 或者配置一些环境变量。

Technologyforgood | 园豆:7541 (大侠五级) | 2024-04-16 20:37

我重新安装了visual studio 2022,然后把C++开发工具选上了,但是还是有报错,请问如何解决呀?(py39) PS D:\Users\Administrator\PycharmProjects\convex_optimizer\DragonDiffusion-master> pip install dlib19.22.0
Looking in indexes: https://repo.huaweicloud.com/repository/pypi/simple/
Collecting dlib
19.22.0
Using cached https://repo.huaweicloud.com/repository/pypi/packages/11/93/ec41d6ef7e769977aa08e49441c52276da27859f12dcbf1c6deb96ce5e9f/dlib-19.22.0.tar.gz (7.4 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [144 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.9.19 (main, Mar 21 2024, 17:21:27) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\tools\python -DCMAKE_LIBRARY_OUTP
UT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=D:\U
sers\Administrator\anaconda3\envs\py39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39 -A x64'
-- Building for: Visual Studio 17 2022
CMake Deprecation Warning at CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
  -- The C compiler identification is MSVC 19.39.33523.0
  -- The CXX compiler identification is MSVC 19.39.33523.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe
  -- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - broken
  CMake Error at D:/Users/Administrator/anaconda3/envs/py39/Lib/site-packages/cmake/data/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):
    The C compiler

      "D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: 'C:/Users/Administrator/AppData/Local/Temp/pip-install-vjhfc5td/dlib_f08599fbb4d3418b9e9a84b13702f7a5/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeScratch/TryCompile-nsyc6f'

      Run Build Command(s): "D:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_6cf47.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n
      閫傜敤浜\x8e .NET Framework MSBuild 鐗堟湰 17.9.8+b34f75857
      鐢熸垚鍚\xaf鍔ㄦ椂闂翠负 2024/4/17 14:23:54銆\x82

      鑺傜偣 1 涓婄殑椤圭洰鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87)銆\x82
      PrepareForBuild:
        姝e湪鍒涘缓鐩\xae褰曗\x80渃mTC_6cf47.dir\Debug\鈥濄\x80\x82
      D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭 

鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑虹幇闂\xae棰樸\x80\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
宸插惎鐢ㄧ粨鏋勫寲杈撳嚭銆傜紪璇戝櫒璇婃柇鐨勬牸寮忚\xae剧疆灏嗗弽鏄犻敊璇\xaf灞傛\xac$粨鏋勩\x80傛湁鍏宠\xaf︾粏淇℃伅锛岃\xaf峰弬闃\x85 https://aka.ms/cpp/structured-output銆\x82
姝e湪鍒涘缓鐩\xae褰曗\x80淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\Debug\鈥濄\x80\x82
姝e湪鍒涘缓鐩\xae褰曗\x80渃mTC_6cf47.dir\Debug\cmTC_6cf47.tlog\鈥濄\x80\x82
InitializeBuildStatus:
姝e湪鍒涘缓鈥渃mTC_6cf47.dir\Debug\cmTC_6cf47.tlog\unsuccessfulbuild鈥濓紝鍥犱负宸叉寚瀹氣\x80淎lwaysCreate鈥濄\x80\x82
姝e湪瀵光\x80渃mTC_6cf47.dir\Debug\cmTC_6cf47.tlog\unsuccessfulbuild鈥濇墽琛\x8c Touch 浠诲姟銆\x82
ClCompile:
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\CL.exe /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBC
S /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR="Debug"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_6cf47.dir\Debug\" /Fd"cmTC_6cf47.dir\Deb
ug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\testCCompiler.c"
鐢ㄤ簬 x64 鐨\x84 Microsoft (R) C/C++ 浼樺寲缂栬瘧鍣\xa8 19.39.33523 鐗\x88
鐗堟潈鎵\x80鏈\x89(C) Microsoft Corporation銆備繚鐣欐墍鏈夋潈鍒┿\x80\x82
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:for
Scope /Zc:inline /Fo"cmTC_6cf47.dir\Debug\" /Fd"cmTC_6cf47.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\testCCompiler.c"
testCCompiler.c
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鎸囧畾鐨勪换鍔″彲鎵ц\xa1屾
浠垛\x80淐L.exe鈥濇湭鑳借繍琛屻\x80係ystem.IO.DirectoryNotFoundException: 鏈\xaa鑳芥壘鍒拌矾寰勨\x80淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dli i
b_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.dir\Debug\cmTC_6cf47.tlog鈥濈殑涓\x80閮ㄥ
銆\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeSc cratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.__Erro
r.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy
stemEnumerableIterator1.CommonInit() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj] D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy stemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkH
ost) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.Direct
ory.GetFiles(String path, String searchPattern) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.PostExecuteTool(Int32 exitCode) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.ToolTask.Execute() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
宸插畬鎴愮敓鎴愰」鐩\xae鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87)鐨勬搷浣\x9c - 澶辫触銆\x82

      鐢熸垚澶辫触銆\x82

      鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87) (1) ->
      (PrepareForBuild 鐩\xae鏍\x87) ->
        D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳 

嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑虹幇闂\xae棰樸\x80\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]

      鈥淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87) (1) ->
      (ClCompile 鐩\xae鏍\x87) ->
        D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鎸囧畾鐨勪换鍔″彲鎵ц\xa1

屾枃浠垛\x80淐L.exe鈥濇湭鑳借繍琛屻\x80係ystem.IO.DirectoryNotFoundException: 鏈\xaa鑳芥壘鍒拌矾寰勨\x80淐:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\d
lib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.dir\Debug\cmTC_6cf47.tlog鈥濈殑涓\x80閮
垎銆\x82 [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMake eScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.__Erro
r.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy
stemEnumerableIterator1.CommonInit() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj] D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.FileSy stemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkH
ost) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 System.IO.Direct
ory.GetFiles(String path, String searchPattern) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.PostExecuteTool(Int32 exitCode) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
CPPTasks.CL.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6003: 鍦\xa8 Microsoft.Build.
Utilities.ToolTask.Execute() [C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\temp.win-amd64-cpython-39\Release\CMakeFiles\CMakeScratch\TryCompile-nsyc6f\cmTC_6cf47.vcxproj]

          1 涓\xaa璀﹀憡
          1 涓\xaa閿欒\xaf\xaf

      宸茬敤鏃堕棿 00:00:01.28





    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 "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py", line 222, in <module>
      setup(
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\wheel\bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
      self.run_command(cmd_name)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py", line 134, in run
      self.build_extension(ext)
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\setup.py", line 171, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "D:\Users\Administrator\anaconda3\envs\py39\lib\subprocess.py", line 373, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-vjhfc5td\\dlib_f08599fbb4d3418b9e9a84b13702f7a5\\too

ls\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=D:\Users\Administrator\anaconda3\envs\py39\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-vjhfc5td\dlib_f08599fbb4d3418b9e9a84b13702f7a5\build\lib.win-amd64-cpython-39', '-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
Running setup.py clean for dlib
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects

支持(0) 反对(0) wendy_ann | 园豆:74 (初学一级) | 2024-04-17 14:32

@wendy_ann: 你这乱码是utf8格式的,ansi显示不了. 你先执行chcp 65001 切换到utf8,再运行你的命令,就能看到完整的错误信息了.好像是CL.exe的路径有问题

支持(0) 反对(0) www378660084 | 园豆:1143 (小虾三级) | 2024-04-18 10:48
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册