1.下载Ubuntu (or Linux)系统支持库=>Install OS libraries
sudo apt-get install build-essential cmake pkg-config libx11-dev libatlas-base-dev libgtk-3-dev libboost-python-dev
2.安装与Python版本一致的相关库=>Install Python libraries
sudo apt-get install python3.6-dev python3-pip 此处是3.6版本的python
3.Step3:编译并安装Dlib=>Compile Dlib
https://link.zhihu.com/?target=http%3A//dlib.net/files/ 本人安装的版
版本:dlib-19.16.tar.bz2
3.1C++编译(Compile C++ binary)
tar xvf dlib-19.16.tar.bz2 解压文件
cd dlib-19.16/
mkdir build
cd build
cmake ..
cmake --build . --config Release
sudo make install
sudo ldconfig
cd..
3.2Python编译(Compile Python module)
方法一:
pip install dlib==19.16
方法二:
# move to dlib's root directory
cd dlib-19.16
sudo python setup.py install
# clean up(this step is required if you want to build dlib for both Python2 and Python3)
rm -rf dist
rm -rf tool/python/build
rm python_examples/dlib.so