question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dlib installation failed

See original GitHub issue
  • face_recognition version:
  • Python version:3.6.9
  • Operating System: centos 6

Description

having errors while installing dlib on a web server

What I Did

[root@server ~]# [root@server ~]# python -m pip install dlib

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q_joqma2/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q_joqma2/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 /tmp/pip-wheel-1retrsw4
       cwd: /tmp/pip-install-q_joqma2/dlib/
  Complete output (65 lines):
  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.9 (default, Nov 11 2019, 10:00:15)
  Invoking CMake setup: 'cmake /tmp/pip-install-q_joqma2/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-q_joqma2/dlib/build/lib.linux-x86_64-3.6 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release'
  -- The C compiler identification is GNU 4.4.7
  -- The CXX compiler identification is GNU 4.4.7
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ - works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Found PythonInterp: /usr/bin/python3 (found version "3.6.9")
  -- Found PythonLibs: /opt/rh/rh-python36/root/usr/lib64/libpython3.6m.so
  -- Performing Test HAS_CPP14_FLAG
  -- Performing Test HAS_CPP14_FLAG - Failed
  -- Performing Test HAS_CPP11_FLAG
  -- Performing Test HAS_CPP11_FLAG - Failed
  CMake Error at /tmp/pip-install-q_joqma2/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:32 (message):
    Unsupported compiler -- pybind11 requires C++11 support!
  Call Stack (most recent call first):
    /tmp/pip-install-q_joqma2/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)


  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-q_joqma2/dlib/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
  See also "/tmp/pip-install-q_joqma2/dlib/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-q_joqma2/dlib/setup.py", line 261, in <module>
      'Topic :: Software Development',
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-q_joqma2/dlib/setup.py", line 135, in run
      self.build_extension(ext)
    File "/tmp/pip-install-q_joqma2/dlib/setup.py", line 172, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "/opt/rh/rh-python36/root/usr/lib64/python3.6/subprocess.py", line 311, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-q_joqma2/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-q_joqma2/dlib/build/lib.linux-x86_64-3.6', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
  ----------------------------------------
  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: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q_joqma2/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q_joqma2/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 /tmp/pip-record-61yk02ds/install-record.txt --single-version-externally-managed --compile --install-headers /opt/rh/rh-python36/root/usr/include/python3.6m/dlib
         cwd: /tmp/pip-install-q_joqma2/dlib/
    Complete output (67 lines):
    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.9 (default, Nov 11 2019, 10:00:15)
    Invoking CMake setup: 'cmake /tmp/pip-install-q_joqma2/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-q_joqma2/dlib/build/lib.linux-x86_64-3.6 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release'
    -- The C compiler identification is GNU 4.4.7
    -- The CXX compiler identification is GNU 4.4.7
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ - works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonInterp: /usr/bin/python3 (found version "3.6.9")
    -- Found PythonLibs: /opt/rh/rh-python36/root/usr/lib64/libpython3.6m.so
    -- Performing Test HAS_CPP14_FLAG
    -- Performing Test HAS_CPP14_FLAG - Failed
    -- Performing Test HAS_CPP11_FLAG
    -- Performing Test HAS_CPP11_FLAG - Failed
    CMake Error at /tmp/pip-install-q_joqma2/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:32 (message):
      Unsupported compiler -- pybind11 requires C++11 support!
    Call Stack (most recent call first):
      /tmp/pip-install-q_joqma2/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)


    -- Configuring incomplete, errors occurred!
    See also "/tmp/pip-install-q_joqma2/dlib/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
    See also "/tmp/pip-install-q_joqma2/dlib/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-q_joqma2/dlib/setup.py", line 261, in <module>
        'Topic :: Software Development',
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-q_joqma2/dlib/setup.py", line 135, in run
        self.build_extension(ext)
      File "/tmp/pip-install-q_joqma2/dlib/setup.py", line 172, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/subprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-q_joqma2/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-q_joqma2/dlib/build/lib.linux-x86_64-3.6', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DCMAKE_BUILD_TYPE=Release']' returned non-zeroexit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q_joqma2/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q_joqma2/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 /tmp/pip-record-61yk02ds/install-record.txt --single-version-externally-managed --compile --install-headers /opt/rh/rh-python36/root/usr/include/python3.6m/dlibCheck the logs for full command output.
[root@server ~]#```

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
KyleS98commented, Jul 18, 2020

Install cmake first with pip.

0reactions
the-king-of-piratecommented, Nov 23, 2021

Hello I also have the same problem, so if anyone has found a solution to that then your help will be truly appreciated

Read more comments on GitHub >

github_iconTop Results From Across the Web

failing to install dlib on windows 10 [duplicate] - Stack Overflow
I have Numpy, opencv-python, setuptools and wheel installed. tried installing dlib then got the first error asking me to install CMake.
Read more >
Dlib build error during face recognition installation #894 - GitHub
I wastrying to install facerecognition module but building the dlib wheel file throws the following exception. I have previously installed dlib ...
Read more >
running setup.py install for dlib did not run successfully.
How to solve setup.py error during install dlib in Python ... 1 Answer. Sometimes we need to manage the Windows PATH environment for...
Read more >
Trying to deploy face_recognition app- error such as dlib ...
Why? The installation of face-recognition requires dlib to be compiled. When dlib is being compiled, the compiler runs out of RAM ...
Read more >
How to Install dlib Library for python in windows 10
First of all we have to set up the environment for the installation of dlib library. There are a few things that should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found