ubuntu 安装dlib ERROR: Failed building wheel for dlib
报错信息
pip install -i https://pypi.douban.com/simple dlib
Looking in indexes: https://pypi.douban.com/simple
Collecting dlib==18.17.100
Using cached https://pypi.doubanio.com/packages/2e/63/801499a0aa588ac29b3400477848caa43e6cbb76af3c1568fcd4b0c21cfd/dlib-18.17.100.zip (4.4 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /root/anaconda3/envs/face_pretty/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-4mrjodat
cwd: /tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/
Complete output (29 lines):
running bdist_wheel
running build
Detected Python architecture: 64bit
Configuring cmake ...
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/tools/python/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/tools/python/build/CMakeFiles/CMakeError.log".
error: cmake configuration failed!
----------------------------------------
ERROR: 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
ERROR: Command errored out with exit status 1:
command: /root/anaconda3/envs/face_pretty/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-gm4__qrg/install-record.txt --single-version-externally-managed --compile --install-headers /root/anaconda3/envs/face_pretty/include/python3.7m/dlib
cwd: /tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/
Complete output (30 lines):
running install
running build
Detected Python architecture: 64bit
Removing build directory /tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/./tools/python/build
Configuring cmake ...
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Detecting C compile features - done
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/tools/python/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/tools/python/build/CMakeFiles/CMakeError.log".
error: cmake configuration failed!
----------------------------------------
ERROR: Command errored out with exit status 1: /root/anaconda3/envs/face_pretty/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2vvtrutd/dlib_bc0b40ba89e7439a93c82c67e195f1a2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-gm4__qrg/install-record.txt --single-version-externally-managed --compile --install-headers /root/anaconda3/envs/face_pretty/include/python3.7m/dlib Check the logs for full command output.