安装与编译Dlib(以Ubuntu16.04+Python3.6+pip为例) Step1:下载Ubuntu (or Linux)系统支持库=Install OS librariessudo apt-get install build-essential cmake pkg-config libx11-dev libatlas-base-dev libgt...

安装与编译Dlib(以Ubuntu16.04+Python3.6+pip为例)
Step1:下载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
Step 2:安装与Python版本一致的相关库=>Install Python libraries
sudo apt-get install python3.6-dev python3-pip
(注意:这里的python3.6-dev对应的是Python3.6这个版本)
Step3:编译并安装Dlib=>Compile Dlib
0)准备工作,去官网下载源码:http://dlib.net/files/
1) C++编译(Compile C++ binary)
wget http://dlib.net/files/dlib-19.16.tar.bz2 (如果已经下载源码,这一步不需要。)
tarxvf dlib-19.16.tar.bz2 cd dlib-19.16/ mkdir build cd build cmake .. cmake --build . --config Release sudo make install sudo ldconfig cd..
2) Python编译(Compile Python module)
本质来说,就是C++编译基础上添加Python调用模块。
这种方法较多,常见以下几种:
a.直接pip编译安装:
sudo pip install dlib==19.16 或者 sudo pip3 install dlib==19.16
b.进入dlib的目录用setup.py文件方式编译安装:
# 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
题外知识:apt-get的使用
1、更新软件数据库:sudo apt-get update
2、查找你想要的软件:sudo apt-cache search softwareName
3、从查找的结果中找到你想安装的软件,然后:sudo apt-get install softwareNameYouFound
备注:斜体字为命令的参数,需要根据用户需要安装的软件名称而改变。
---------------------------------------------------------
可以用命令:sudo apt-cache -h来得到更多信息。
---------------------------------------------------------
例如:我想安装eclipse,但我不知道是否能通过apt-get命令来安装,如下操作:
1、sudo apt-get update.
2、sudo apt-cache search eclipse这时,可以看到有
3、这时可以用以下命令安装eclipse:sudo apt-get install eclipse
本文标题为:安装与编译Dlib(以Ubuntu16.04+Python3.6+pip为例)


基础教程推荐
- 详解pandas df.iloc[]的典型用法 2022-08-30
- Windows 下update pip 报错:Cannot remove entries from nonexistent file c:\intelpython3\lib\site-packa 2023-09-04
- 如何在Windows上使用python使我的脚本每30分钟重复一次 2023-11-11
- python爬取免费代理并验证代理是否可用 2023-08-04
- Python四大金刚之列表详解 2023-08-04
- python-在子目录nginx uwsgi上提供Flask应用 2023-11-11
- Python实现将DNA序列存储为tfr文件并读取流程介绍 2022-10-20
- python-为什么在Windows下wx.Yield()显然不屈服 2023-11-12
- Python扑克牌21点游戏实例代码 2023-08-04
- 【Python】进程和多线程分别适用于什么情况? 2023-09-05