gpt4 book ai didi

python-3.x - Dlib安装错误?

转载 作者:行者123 更新时间:2023-12-04 15:50:29 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





dlib installation on Windows 10

(18 个回答)


2年前关闭。




未安装 Visual Studio 2015
在 python 中构建 dlib 之前,我已经安装了所有要求:
制作

python 3.6 和其他绑定(bind)。

使用 pip 安装 dlib 时:

pip install dlib

出现错误:
Collecting dlib
Using cached https://files.pythonhosted.org/packages/df/aa/6a9bb2a763107bb2606d6ee1aa65fcd3b51375a9ef6436e9c9280b0dd63c/dlib-19.15.0.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command "c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-wheel-nnayeybw --python-tag cp36:
running bdist_wheel
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -DPYTHON_EXECUTABLE=c:\users\vikas tiwari\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17134.
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 8/7/2018 1:07:47 PM.
Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.03


Exit code: 1



-- Configuring incomplete, errors occurred!
See also "C:/Users/Vikas Tiwari/AppData/Local/Temp/pip-install-4f4b8868/dlib/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 202, in run
self.run_command('build')
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\vikas tiwari\anaconda3\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\vikas tiwari\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.

----------------------------------------
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:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-record-aol24hcc\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -DPYTHON_EXECUTABLE=c:\users\vikas tiwari\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17134.
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 8/7/2018 1:07:50 PM.
Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.03


Exit code: 1



-- Configuring incomplete, errors occurred!
See also "C:/Users/Vikas Tiwari/AppData/Local/Temp/pip-install-4f4b8868/dlib/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\vikas tiwari\anaconda3\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\vikas tiwari\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.

----------------------------------------
Command ""c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-record-aol24hcc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\

我真的不知道这里的真正问题是什么。我是否必须安装 Visual Studio 才能编译 dlib 的 c++ 文件?
现在没有安装 VS 2015!!

最佳答案

干得好 :

  • cmake 下载 CMake并将其添加到 PATH(C:\Program Files\CMake\bin)
  • 使用 pip 安装 dlib (pip install dlib==19.4)
  • 关于python-3.x - Dlib安装错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51721695/

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