ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.33k stars 13.36k forks source link

dlib installation failed #1186

Open ambarishak96 opened 3 years ago

ambarishak96 commented 3 years ago

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 ~]#```
KyleS98 commented 3 years ago

Install cmake first with pip.

raybg commented 3 years ago

I installed Visual Studio 2019 (Latest Version) and was able to install face_recognition, dlib, cmake and other related through pip install, which earlier was not happening.

zeintiz commented 3 years ago

i installed visual studio 2015, 2017 ,2019 build , toolset ,.... but dlib couldn't install properly. with this error:

ERROR: Command errored out with exit status 1: 'D:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-zwmpd9jv\dlib_b2c0550272524a6bb2eb2269a2dc949d\setup.py'"'"'; file='"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-zwmpd9jv\dlib_b2c0550272524a6bb2eb2269a2dc949d\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\Lenovo\AppData\Local\Temp\pip-record-kpn8wovn\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\ProgramData\Anaconda3\Include\dlib' Check the logs for full command output.

please help. tank u in advance

shraoned commented 3 years ago

i installed visual studio 2015, 2017 ,2019 build , toolset ,.... but dlib couldn't install properly. with this error:

ERROR: Command errored out with exit status 1: 'D:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-zwmpd9jv\dlib_b2c0550272524a6bb2eb2269a2dc949d\setup.py'"'"'; file='"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-zwmpd9jv\dlib_b2c0550272524a6bb2eb2269a2dc949d\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\Lenovo\AppData\Local\Temp\pip-record-kpn8wovn\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\ProgramData\Anaconda3\Include\dlib' Check the logs for full command output.

please help. thank u in advance

Same Error...I'm new in python so, I don't know whats happening

wahyu-handayani commented 2 years ago

Hi, I face the same problem when install it in centos 7. I have been installing cmake first but I still getting error when installing dlib

Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] 
.......
the-king-of-pirate commented 2 years ago

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

abedputra commented 1 year ago

Hi, I face the same problem when install it in centos 7. I have been installing cmake first but I still getting error when installing dlib

Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] 
.......

same problem here, anyone solves this?