Hello there,
Following the tutorial to install OPenCV 4 on centos 7. I got stuck at installing DLIB through pip install
After a few hours researching in the web, I only founf solutions installing Anaconda. However, I’d like to exhaust my options first, before moving forward with this option.
Does OpenCV build really require DLIB? For what?
Has anyone got into the same problem? (logs are bellow)
Best wishes,
I
Defaulting to user installation because normal site-packages is not writeable
Collecting dlib
Using cached dlib-19.22.0.tar.gz (7.4 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/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-wxulgndz
cwd: /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/
Complete output (141 lines):
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.6.8 (default, Nov 16 2020, 16:55:22)
Invoking CMake setup: 'cmake /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/build/lib.linux-x86_64-3.6 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- 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
-- 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
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.8")
-- Found PythonLibs: /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 - Success
-- pybind11 v2.2.4
-- Using CMake version: 2.8.12.2
-- Compiling dlib version: 19.22.0
-- SSE4 instructions can be executed by the host processor.
-- Enabling SSE4 instructions
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib64/libX11.so
-- Found system copy of libpng: /usr/lib64/libpng.so;/usr/lib64/libz.so
-- Found system copy of libjpeg: /usr/lib64/libjpeg.so
-- Searching for BLAS and LAPACK
-- Searching for BLAS and LAPACK
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
-- checking for module 'cblas'
-- package 'cblas' not found
-- checking for module 'lapack'
-- package 'lapack' not found
-- Looking for cblas_ddot
-- Looking for cblas_ddot - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
*****************************************************************************
*** No BLAS library found so using dlib's built in BLAS. However, if you ***
*** install an optimized BLAS such as OpenBLAS or the Intel MKL your code ***
*** will run faster. On Ubuntu you can install OpenBLAS by executing: ***
*** sudo apt-get install libopenblas-dev liblapack-dev ***
*** Or you can easily install OpenBLAS from source by downloading the ***
*** source tar file from http://www.openblas.net, extracting it, and ***
*** running: ***
*** make; sudo make install ***
*****************************************************************************
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
-- Found CUDA, but CMake was unable to find the cuBLAS libraries that should be part of every basic CUDA install. Your CUDA install is somehow broken or incomplete. Since cuBLAS is required for dlib to use CUDA we won't use CUDA.
-- DID NOT FIND CUDA
-- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA
-- C++11 activated.
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/build/temp.linux-x86_64-3.6
Invoking CMake build: 'cmake --build . --config Release -- -j2'
Scanning dependencies of target dlib
[ 1%] [ 2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o
Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o
In file included from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream.h:6:0,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../serialize.h:243,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_1.h:8,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_1.cpp:5:
/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type ‘dlib::vectorstream::vector_streambuf<CharType>::size_type’
size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
^
[ 3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o
gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream.h:6:0,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../serialize.h:243,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_2.h:8,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_2.cpp:5:
/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type ‘dlib::vectorstream::vector_streambuf<CharType>::size_type’
size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
^
gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o] Error 1
gmake[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
gmake: *** [all] Error 2
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py", line 261, in <module>
'Topic :: Software Development',
File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/qonteo/.local/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py", line 134, in run
self.build_extension(ext)
File "/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py", line 174, in build_extension
subprocess.check_call(cmake_build, cwd=build_folder)
File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.
----------------------------------------
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 io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/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-fo88nxh1/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/qonteo/.local/include/python3.6m/dlib
cwd: /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/
Complete output (143 lines):
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.6.8 (default, Nov 16 2020, 16:55:22)
Invoking CMake setup: 'cmake /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/build/lib.linux-x86_64-3.6 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- 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
-- 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
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.8")
-- Found PythonLibs: /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 - Success
-- pybind11 v2.2.4
-- Using CMake version: 2.8.12.2
-- Compiling dlib version: 19.22.0
-- SSE4 instructions can be executed by the host processor.
-- Enabling SSE4 instructions
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib64/libX11.so
-- Found system copy of libpng: /usr/lib64/libpng.so;/usr/lib64/libz.so
-- Found system copy of libjpeg: /usr/lib64/libjpeg.so
-- Searching for BLAS and LAPACK
-- Searching for BLAS and LAPACK
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
-- checking for module 'cblas'
-- package 'cblas' not found
-- checking for module 'lapack'
-- package 'lapack' not found
-- Looking for cblas_ddot
-- Looking for cblas_ddot - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
*****************************************************************************
*** No BLAS library found so using dlib's built in BLAS. However, if you ***
*** install an optimized BLAS such as OpenBLAS or the Intel MKL your code ***
*** will run faster. On Ubuntu you can install OpenBLAS by executing: ***
*** sudo apt-get install libopenblas-dev liblapack-dev ***
*** Or you can easily install OpenBLAS from source by downloading the ***
*** source tar file from http://www.openblas.net, extracting it, and ***
*** running: ***
*** make; sudo make install ***
*****************************************************************************
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
-- Found CUDA, but CMake was unable to find the cuBLAS libraries that should be part of every basic CUDA install. Your CUDA install is somehow broken or incomplete. Since cuBLAS is required for dlib to use CUDA we won't use CUDA.
-- DID NOT FIND CUDA
-- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA
-- C++11 activated.
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/build/temp.linux-x86_64-3.6
Invoking CMake build: 'cmake --build . --config Release -- -j2'
Scanning dependencies of target dlib
[ 1%] [ 2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o
Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o
In file included from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream.h:6:0,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../serialize.h:243,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_1.h:8,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_1.cpp:5:
/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type ‘dlib::vectorstream::vector_streambuf<CharType>::size_type’
size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
^
[ 3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o
gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream.h:6:0,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../serialize.h:243,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_2.h:8,
from /tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/bigint_kernel_2.cpp:5:
/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/dlib/bigint/../vectorstream/vectorstream.h:31:34: error: invalid use of dependent type ‘dlib::vectorstream::vector_streambuf<CharType>::size_type’
size_type read_pos = 0; // buffer[read_pos] == next byte to read from buffer
^
gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o] Error 1
gmake[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
gmake: *** [all] Error 2
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py", line 261, in <module>
'Topic :: Software Development',
File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib64/python3.6/distutils/command/install.py", line 556, in run
self.run_command('build')
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py", line 134, in run
self.build_extension(ext)
File "/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py", line 174, in build_extension
subprocess.check_call(cmake_build, cwd=build_folder)
File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ahe52fgr/dlib_ac8e87cbf9354516a50db46d08546940/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-fo88nxh1/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/qonteo/.local/include/python3.6m/dlib Check the logs for full command output.