过去一周来,我一直在尝试在系统上下载dlib,但我无法使用pip或手动过程来下载它,我也查看了此处提出的几个问题并检查了所需的过程。
但仍然失败了...我需要学习opencv和dlib,所以请任何人帮助我...以及我认为可能不是问题的设备属性。
已安装的C和C ++编译器,并将它们添加到路径中。
安装了Visual Studio 2015(VS2015)下载器和2017两者
通过VS2015安装了所有依赖项。(支持C,C ++,MS Build,Windows SDK等)
C:\Users\Akshay>pip install dlib
Collecting dlib
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc
78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Complete output from command 'c:\users\akshay\appdata\local\programs\
python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\
\Users\\Akshay\\AppData\\Local\\Temp\\pip-install-8qdv7218\\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\Akshay\AppData\Local\Temp\pip-record-dupqe8e6\instal
l-record.txt' --single-version-externally-managed --compile:
ERROR: 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.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:0
5) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Akshay\AppData\Local\Temp\pip-install-
8qdv7218\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Akshay\AppD
ata\Local\Temp\pip-install-8qdv7218\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUT
ABLE=c:\users\akshay\appdata\local\programs\python\python37\python.exe -DCMAKE_L
IBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Akshay\AppData\Local\Temp\pip-install-8
qdv7218\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
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/Akshay/AppData/Local/Temp/pip-install-8qdv7218/dlib/build
/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Akshay\AppData\Local\Temp\pip-install-8qdv7218\dlib\setup.p
y", line 261, in <module>
'Topic :: Software Development',
File "c:\users\akshay\appdata\local\programs\python\python37\lib\site-pack
ages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\core.py", line 148, in setup
dist.run_commands()
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\akshay\appdata\local\programs\python\python37\lib\site-pack
ages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Akshay\AppData\Local\Temp\pip-install-8qdv7218\dlib\setup.p
y", line 135, in run
self.build_extension(ext)
File "C:\Users\Akshay\AppData\Local\Temp\pip-install-8qdv7218\dlib\setup.p
y", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\subproces
s.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Akshay\\AppDat
a\\Local\\Temp\\pip-install-8qdv7218\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUT
PUT_DIRECTORY=C:\\Users\\Akshay\\AppData\\Local\\Temp\\pip-install-8qdv7218\\dli
b\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\akshay\\appdata\\l
ocal\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY
_RELEASE=C:\\Users\\Akshay\\AppData\\Local\\Temp\\pip-install-8qdv7218\\dlib\\bu
ild\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command "'c:\users\akshay\appdata\local\programs\python\python37\python.e
xe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Akshay\\AppData\
\Local\\Temp\\pip-install-8qdv7218\\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:\Us
ers\Akshay\AppData\Local\Temp\pip-record-dupqe8e6\install-record.txt' --single-v
ersion-externally-managed --compile" failed with error code 1 in C:\Users\Akshay
\AppData\Local\Temp\pip-install-8qdv7218\dlib\