Dlib python install error

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip dlib not installing #2596

pip dlib not installing #2596

Comments

Hi, when I try to install dlib with pip, I got an error in the gcc version, but the latest gcc version is installed.

Expected Behavior

Since cmake and gcc are installed, the dlib package must be installed properly.

Current Behavior

Collecting dlib
Using cached dlib-19.24.0.tar.gz (3.2 MB)
Preparing metadata (setup.py) . done
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) . error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [77 lines of output]
running bdist_wheel
running build
running build_py
package init file ‘tools/python/dlib/init.py’ not found (or not a regular file)
running build_ext
Building extension for Python 3.8.12 (default, Jun 6 2022, 21:30:31)
Invoking CMake setup: ‘cmake /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8 -DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python -DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is GNU 4.8.5
— The CXX compiler identification is GNU 4.8.5
— 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
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info — done
— Check for working CXX compiler: /usr/bin/c++ — skipped
— Detecting CXX compile features
— Detecting CXX compile features — done
— Found PythonInterp: /home/axsut/DFDNet/DFDNet/env/bin/python (found version «3.8.12»)
— Found PythonLibs: /usr/local/lib/libpython3.8.a
— Performing Test HAS_CPP14_FLAG
— Performing Test HAS_CPP14_FLAG — Failed
— Performing Test HAS_CPP11_FLAG
— Performing Test HAS_CPP11_FLAG — Success
— pybind11 v2.2.4
— Using CMake version: 3.22.4
— Compiling dlib version: 19.24.0
CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:50 (message):
C++11 is required to use dlib, but the version of GCC you are using is too
old and doesn’t support C++11. You need GCC 4.9 or newer.
Call Stack (most recent call first):
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/test_for_sse4/CMakeLists.txt:8 (include)

 CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/check_if_sse4_instructions_executable_on_host.cmake:13 (try_compile): Failed to configure test project build system. Call Stack (most recent call first): /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:13 (include) /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/CMakeLists.txt:33 (include) -- Configuring incomplete, errors occurred! See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log". See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 222, in setup( File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run self.run_command('build') File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 134, in run self.build_extension(ext) File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 171, in build_extension subprocess.check_call(cmake_setup, cwd=build_folder) File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1. [end of output] 

note: This error originates from a subprocess, and is likely not a problem with pip.
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: subprocess-exited-with-error

× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [79 lines of output]
running install
running build
running build_py
package init file ‘tools/python/dlib/init.py’ not found (or not a regular file)
running build_ext
Building extension for Python 3.8.12 (default, Jun 6 2022, 21:30:31)
Invoking CMake setup: ‘cmake /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8 -DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python -DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is GNU 4.8.5
— The CXX compiler identification is GNU 4.8.5
— 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
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info — done
— Check for working CXX compiler: /usr/bin/c++ — skipped
— Detecting CXX compile features
— Detecting CXX compile features — done
— Found PythonInterp: /home/axsut/DFDNet/DFDNet/env/bin/python (found version «3.8.12»)
— Found PythonLibs: /usr/local/lib/libpython3.8.a
— Performing Test HAS_CPP14_FLAG
— Performing Test HAS_CPP14_FLAG — Failed
— Performing Test HAS_CPP11_FLAG
— Performing Test HAS_CPP11_FLAG — Success
— pybind11 v2.2.4
— Using CMake version: 3.22.4
— Compiling dlib version: 19.24.0
CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:50 (message):
C++11 is required to use dlib, but the version of GCC you are using is too
old and doesn’t support C++11. You need GCC 4.9 or newer.
Call Stack (most recent call first):
/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/test_for_sse4/CMakeLists.txt:8 (include)

 CMake Error at /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/check_if_sse4_instructions_executable_on_host.cmake:13 (try_compile): Failed to configure test project build system. Call Stack (most recent call first): /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/cmake_utils/set_compiler_specific_options.cmake:13 (include) /tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/dlib/CMakeLists.txt:33 (include) -- Configuring incomplete, errors occurred! See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log". See also "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 222, in setup( File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/axsut/DFDNet/DFDNet/env/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/usr/local/lib/python3.8/distutils/command/install.py", line 545, in run self.run_command('build') File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 134, in run self.build_extension(ext) File "/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/setup.py", line 171, in build_extension subprocess.check_call(cmake_setup, cwd=build_folder) File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-hoifmbg8/dlib_2abceb3d874b4ae4bdd246d44369a9ed/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/home/axsut/DFDNet/DFDNet/env/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1. [end of output] 

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

Читайте также:  Upload Folder using PHP

× Encountered error while trying to install package.
╰─> dlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Steps to Reproduce

Platform: Centos 7.9.2009
Cmake version: 3.22.4
GCC verrsion: 9.2.0

Источник

Оцените статью