|
成功安装C++开源库dlib(人脸业务相关)
pip install dlib 后各种报错
CMake must be installed to build the following extensions: dlib
安装cmake:http://www.ai111.vip/thread-977-1-1.html
又报错:找不到gcc g++
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/lib/gcc
-- Check for working C compiler: /usr/lib/gcc -- broken
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/lib/gcc/x86_64-linux-gnu/7
-- Check for working C compiler: /usr/lib/gcc/x86_64-linux-gnu/7 -- broken
安装dlib的时候可能会出问题,因为dlib需要编译,出现的问题一般是gcc或者g++版本的问题,可以通过在命令行键入
dfy888@Dfy888-Ubuntu:~$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dfy888@Dfy888-Ubuntu:~$ g++ --version
g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc -v 信息更多
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
命令找一下:whereis xxx
dfy888@Dfy888-Ubuntu:~$ whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/share/man/man1/gcc.1.gz
dfy888@Dfy888-Ubuntu:~$ whereis g++
g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz
关键在这:终端执行
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
来指定你gcc和g++对应的位置,(这两句话会临时修改当前终端的环境变量/usr/bin/gcc对应你自己gcc或者g++所在目录)
之后成功啦!
|
|