下面给出了在 python 3.6.6 中安装 dlib 时出现的错误。我在 Windows 10 的 dlib 19.15 文件夹中使用命令“python setup.py install”。
Posted
技术标签:
【中文标题】下面给出了在 python 3.6.6 中安装 dlib 时出现的错误。我在 Windows 10 的 dlib 19.15 文件夹中使用命令“python setup.py install”。【英文标题】:Given below is error while installing dlib in python 3.6.6. I am using command "python setup.py install" inside dlib 19.15 folder in windows 10. 【发布时间】:2019-01-05 17:25:27 【问题描述】:下面给出的是错误。请帮忙。安装时发生错误。我正在使用 dlib 19.15 版。我认为 cmake 配置不正确。你们可以检查并告诉错误在哪里吗?我正在使用 cmake 版本 3.12 。我正在使用 python 3.6.6 和 pip 版本 10(不是最新的)。我正在使用 Windows 10 核心 i5。我很沮丧。
running install
running bdist_egg
running egg_info
writing dlib.egg-info\PKG-INFO
writing dependency_links to dlib.egg-info\dependency_links.txt
writing top-level names to dlib.egg-info\top_level.txt
package init file 'dlib\__init__.py' not found (or not a regular file)
reading manifest file 'dlib.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
Building extension for Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\HP\AppData\Local\Programs\Python\Python36\Lib\site-packages\dlib-19.15\tools\python - DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\HP\AppData\Local\Programs\Python\Python36\Lib\site-packages\dlib-19.15\build\lib.win-amd64-3.6 -DPYTHON_EXECUTABLE=C:\Users\HP\AppData\Local\Programs\Python\Python36\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\HP\AppData\Local\Programs\Python\Python36\Lib\site-packages\dlib-19.15\build\lib.win-amd64-3.6 -A x64'
CMake Error in CMakeLists.txt:
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/HP/AppData/Local/Programs/Python/Python36/Lib/site- packages/dlib-19.15/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "setup.py", line 257, in <module>
'Topic :: Software Development',
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 133, in run
self.build_extension(ext)
File "setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\dlib-19.15\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\dlib-19.15\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\dlib-19.15\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.
【问题讨论】:
【参考方案1】:现在已经修复了。我只需要安装 Visual Studio,因为 cmake 需要它来编译 .cxx 文件。
【讨论】:
以上是关于下面给出了在 python 3.6.6 中安装 dlib 时出现的错误。我在 Windows 10 的 dlib 19.15 文件夹中使用命令“python setup.py install”。的主要内容,如果未能解决你的问题,请参考以下文章
在 Alpine Linux Docker 容器中安装 ODBC 驱动程序
ini 我的自定义tmux配置可以提高工作效率。别忘了在OSX中安装reattach-to-user-namespace以便复制粘贴工作。