Collecting dlib==19.19.0
Using cached dlib-19.19.0.tar.gz (3.2 MB)
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: still running...
Running setup.py install for dlib: still running...
Running setup.py install for dlib: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'D:\Pycharm\OpenCV\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pycharm-packaging\\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\ADMINI~1\AppData\Local\Temp\pip-record-eq4mtkyn\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Pycharm\OpenCV\venv\include\site\python3.6\dlib'
cwd: C:\Users\Administrator\AppData\Local\Temp\pycharm-packaging\dlib\
Complete output (77 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
Building extension for Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pycharm-packaging\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6 -DPYTHON_EXECUTABLE=D:\Pycharm\OpenCV\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6'
-- Building for: Visual Studio 12 2013
-- The C compiler identification is MSVC 18.0.30501.0
-- The CXX compiler identification is MSVC 18.0.30501.0
-- Check for working C compiler: F:/VS2013/VC/bin/cl.exe
-- Check for working C compiler: F:/VS2013/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: F:/VS2013/VC/bin/cl.exe
-- Check for working CXX compiler: F:/VS2013/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: D:/Pycharm/OpenCV/venv/Scripts/python.exe (found version "3.6.4")
-- Found PythonLibs: D:/python3/libs/Python36.lib
-- pybind11 v2.2.2
-- Using CMake version: 3.12.0
-- Compiling dlib version: 19.19.0
CMake Error at C:/Users/Administrator/AppData/Local/Temp/pycharm-packaging/dlib/dlib/cmake_utils/set_compiler_specific_options.cmake:31 (message):
C++11 is required to use dlib, but the version of Visual Studio you are
using is too old and doesn't support C++11. You need Visual Studio 2015 or
newer.
Call Stack (most recent call first):
C:/Users/Administrator/AppData/Local/Temp/pycharm-packaging/dlib/dlib/cmake_utils/test_for_sse4/CMakeLists.txt:8 (include)
这是我电脑安装出现的问题,我通过知乎和此博客得知——要升级VS2013,因为我的VS2013版本过低。但VS2013卸载不掉,还是有问题。又去搜如何卸载VS2013,最后看运气了
如果运气好,就下载dlib-18.17.100-cp27-none-win32.whl ,类似版本。安装pip install dlib=18.17.100