python CentOS7 搭建Dlib+OpenCV

OpenCV 同时被 2 个专栏收录
20 篇文章 1 订阅
91 篇文章 2 订阅

一、基础套餐

yum update
yum groupinstall "Development Tools"

二、安装OpenCV

yum install cmake
yum install python-devel numpy
yum install gcc gcc-c++
yum install gtk2-devel
yum install libdc1394-devel
yum install libv4l-devel
yum install ffmpeg-devel
yum install gstreamer-plugins-base-devel
yum install libpng-devel
yum install libjpeg-turbo-devel
yum install jasper-devel
yum install openexr-devel
yum install libtiff-devel
yum install libwebp-devel
yum install opencv
yum install opencv-python
yum install opencv-devel

yum install cmake python-devel numpy gcc gcc-c++ gtk2-devel libdc1394-devel libv4l-devel ffmpeg-devel gstreamer-plugins-base-devel libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel opencv opencv-python opencv-devel 

查看gcc版本

g++ --version

 

ps: c++  版本大等于 gcc4.8.2 可以跳过

三、安装C++11(gcc4.8.2),不升级gcc,lib装不上

wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
sudo yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++

软件会被安装在/opt/rh目录下

配置环境变量

export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc  
export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++

别忘了. /etc/profile

查看gcc版本

g++ --version 

将安装的目录软链接到local/bin

 

ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r

 

四、安装boost

 

yum install boost  
yum install boost-devel  
yum install boost-doc

yum install boost boost-devel boost-doc 

 

五、安装Dlib

pip install dlib

 

六、安装libXdmcp

这时候import dlib会报错,需要libXdmcp

yum install libXdmcp libXdmcp-devel

 

 

 

  • 3
    点赞
  • 0
    评论
  • 1
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值