我正在尝试在python3(版本3.5)中使用pip3安装face_recognition模块。我已经安装了所有预先需要的模块,包括cmake,libboost等。但是每当我尝试使用以下命令安装face_recognition时 -
sudo -H pip3 install face_recognition
终端卡在构建轮dlib中的setup.py线上,只有在很长一段时间后才显示有关c ++和cmake失败的错误。
smartdb@ubuntu:~$ sudo -H pip3 install face_recognition
[sudo] password for smartdb:
Collecting face_recognition
Downloading face_recognition-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (from face_recognition)
Requirement already satisfied: scipy>=0.17.0 in /usr/local/lib/python3.5/dist-packages (from face_recognition)
Collecting Click>=6.0 (from face_recognition)
Downloading click-6.7-py2.py3-none-any.whl (71kB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 71kB 400kB/s
Requirement already satisfied: numpy in /usr/local/lib/python3.5/dist-packages (from face_recognition)
Collecting face-recognition-models>=0.2.0 (from face_recognition)
Downloading face_recognition_models-0.3.0.tar.gz (100.1MB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 100.2MB 2.8kB/s
Collecting dlib>=19.5 (from face_recognition)
Using cached dlib-19.8.1.tar.gz
Building wheels for collected packages: face-recognition-models, dlib
Running setup.py bdist_wheel for face-recognition-models ... done
Stored in directory: /root/.cache/pip/wheels/05/32/f2/440351db9ce1eb483696f83300f3d313f2f265403f0e69c481
Running setup.py bdist_wheel for dlib ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qdefttr5/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/tmp57qgi2e_pip-wheel- --python-tag cp35:
running bdist_wheel
running build
Detected Python architecture: 64bit
Detected platform: linux
Configuring cmake ...
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- 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
CMake Warning at /usr/share/cmake-3.7/Modules/FindBoost.cmake:1534 (message):
No header defined for python-py34; skipping header check
Call Stack (most recent call first):
/tmp/pip-build-qdefttr5/dlib/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
-- Could NOT find Boost
CMake Warning at /usr/share/cmake-3.7/Modules/FindBoost.cmake:1534 (message):
No header defined for python-py35; skipping header check
Call Stack (most recent call first):
/tmp/pip-build-qdefttr5/dlib/dlib/cmake_utils/add_python_module:68 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
-- Boost version: 1.62.0
-- Found the following Boost libraries:
-- python-py35
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found suitable version "3.5.3", minimum required is "3.4")
-- Enabling SSE4 instructions
-- Looking for pthread.h
-- Looking for 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/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/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
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Looking for png_create_read_struct
-- Looking for png_create_read_struct - found
-- Searching for BLAS and LAPACK
-- Searching for BLAS and LAPACK
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'cblas'
-- No package 'cblas' found
-- Checking for module 'lapack'
-- No package 'lapack' 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
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
*****************************************************************************
*** 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")
-- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA
-- C++11 activated.
-- USING BOOST_LIBS: /usr/lib/x86_64-linux-gnu/libboost_python-py35.so
-- Found PythonInterp: /usr/bin/python3.5 (found version "3.5.3")
-- Found Python with installed numpy package
-- Numpy include path '/usr/local/lib/python3.5/dist-packages/numpy/core/include'
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-build-qdefttr5/dlib/tools/python/build
Build using cmake ...
Scanning dependencies of target dlib
[ 0%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o
[ 1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o
[ 2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o
[ 3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o
[ 4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o
[ 4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o
[ 5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o
[ 6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o
[ 7%] Building CXX object dlib_build/CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o
[ 8%] Building CXX object dlib_build/CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o
[ 9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/unicode/unicode.cpp.o
[ 9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o
[ 10%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/mnist.cpp.o
[ 11%] Building CXX object dlib_build/CMakeFiles/dlib.dir/global_optimization/global_function_search.cpp.o
[ 12%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_1.cpp.o
[ 13%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bsp/bsp.cpp.o
[ 13%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_1.cpp.o
[ 14%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_2.cpp.o
[ 15%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_extensions.cpp.o
[ 16%] Building CXX object dlib_build/CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o
[ 17%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/extra_logger_headers.cpp.o
[ 18%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_kernel_1.cpp.o
[ 18%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_config_file.cpp.o
[ 19%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_1.cpp.o
[ 20%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_2.cpp.o
[ 21%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_extensions.cpp.o
[ 22%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_2.cpp.o
[ 22%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf.cpp.o
[ 23%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf_unbuffered.cpp.o
[ 24%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_kernel.cpp.o
[ 25%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_iostream.cpp.o
[ 26%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_http.cpp.o
[ 27%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/multithreaded_object_extension.cpp.o
[ 27%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threaded_object_extension.cpp.o
[ 28%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_1.cpp.o
[ 29%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_2.cpp.o
[ 30%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_shared.cpp.o
[ 31%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/thread_pool_extension.cpp.o
[ 31%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/async.cpp.o
[ 32%] Building CXX object dlib_build/CMakeFiles/dlib.dir/timer/timer.cpp.o
[ 33%] Building CXX object dlib_build/CMakeFiles/dlib.dir/stack_trace.cpp.o
[ 34%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dnn/cpu_dlib.cpp.o
[ 35%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dnn/tensor_tools.cpp.o
[ 36%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o
[ 36%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/widgets.cpp.o
[ 37%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/drawable.cpp.o
[ 38%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/canvas_drawing.cpp.o
[ 39%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/style.cpp.o
[ 40%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/base_widgets.cpp.o
[ 40%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_1.cpp.o
[ 41%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_2.cpp.o
[ 42%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_loader/png_loader.cpp.o
[ 43%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_saver/save_png.cpp.o
[ 44%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcomapi.cpp.o
[ 45%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdapimin.cpp.o
[ 45%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdapistd.cpp.o
[ 46%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdatasrc.cpp.o
[ 47%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdcoefct.cpp.o
[ 48%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdcolor.cpp.o
[ 49%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jddctmgr.cpp.o
[ 50%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdhuff.cpp.o
[ 50%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdinput.cpp.o
[ 51%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdmainct.cpp.o
[ 52%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdmarker.cpp.o
[ 53%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdmaster.cpp.o
[ 54%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdmerge.cpp.o
[ 54%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdphuff.cpp.o
[ 55%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdpostct.cpp.o
[ 56%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdsample.cpp.o
[ 57%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jerror.cpp.o
[ 58%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jidctflt.cpp.o
[ 59%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jidctfst.cpp.o
[ 59%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jidctint.cpp.o
[ 60%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jidctred.cpp.o
[ 61%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jmemmgr.cpp.o
[ 62%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jmemnobs.cpp.o
[ 63%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jquant1.cpp.o
[ 63%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jquant2.cpp.o
[ 64%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jutils.cpp.o
[ 65%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcapimin.cpp.o
[ 66%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jdatadst.cpp.o
[ 67%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcparam.cpp.o
[ 68%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcapistd.cpp.o
[ 68%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcmarker.cpp.o
[ 69%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcinit.cpp.o
[ 70%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcmaster.cpp.o
[ 71%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcdctmgr.cpp.o
[ 72%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jccoefct.cpp.o
[ 72%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jccolor.cpp.o
[ 73%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jchuff.cpp.o
[ 74%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcmainct.cpp.o
[ 75%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcphuff.cpp.o
[ 76%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcprepct.cpp.o
[ 77%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jcsample.cpp.o
[ 77%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jfdctint.cpp.o
[ 78%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jfdctflt.cpp.o
[ 79%] Building CXX object dlib_build/CMakeFiles/dlib.dir/external/libjpeg/jfdctfst.cpp.o
[ 80%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_loader/jpeg_loader.cpp.o
[ 81%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_saver/save_jpeg.cpp.o
[ 81%] Linking CXX static library libdlib.a
[ 81%] Built target dlib
Scanning dependencies of target dlib_
[ 82%] Building CXX object CMakeFiles/dlib_.dir/src/dlib.cpp.o
[ 83%] Building CXX object CMakeFiles/dlib_.dir/src/matrix.cpp.o
[ 84%] Building CXX object CMakeFiles/dlib_.dir/src/vector.cpp.o
[ 85%] Building CXX object CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o
[ 86%] Building CXX object CMakeFiles/dlib_.dir/src/svm_rank_trainer.cpp.o
[ 86%] Building CXX object CMakeFiles/dlib_.dir/src/decision_functions.cpp.o
[ 87%] Building CXX object CMakeFiles/dlib_.dir/src/other.cpp.o
[ 88%] Building CXX object CMakeFiles/dlib_.dir/src/basic.cpp.o
[ 89%] Building CXX object CMakeFiles/dlib_.dir/src/cca.cpp.o
[ 90%] Building CXX object CMakeFiles/dlib_.dir/src/sequence_segmenter.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
CMakeFiles/dlib_.dir/build.make:278: recipe for target 'CMakeFiles/dlib_.dir/src/sequence_segmenter.cpp.o' failed
make[2]: *** [CMakeFiles/dlib_.dir/src/sequence_segmenter.cpp.o] Error 4
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dlib_.dir/all' failed
make[1]: *** [CMakeFiles/dlib_.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
error: cmake build failed!
----------------------------------------
Failed building wheel for dlib
我在VMware Workstation 14 Pro上运行Ubuntu 16.04
答案 0 :(得分:1)
你读过输出了吗?
c++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-6/README.Bugs>
您的编译器崩溃了。这不应该发生。请更新您的编译器(GCC 7或最新的6.x版本)或从LLVM项目切换到Clang 如果它与新版本的GCC一起崩溃,请提交错误。
除此之外,你无能为力。