【树莓派入坑指南系列】Raspberry Pi 4B树莓派安装opencv安装依赖libtiff5总是失败?震惊:这一招能填平你在安装依赖时候的坑!!!

目录


1.OpencCV-python安装中依赖安装问题

2.入坑第一课:切勿无脑换源


1.OpencCV-python安装中依赖安装问题

  
  相信大家大部分都会拿手里的树莓派装一个openvc-python,不例外,俺也一样。但是今天在安装过程中遇到一个问题:在跟着网上教程安装过程中,安装依赖 “libtiff5“ 时”出现了问题:

错误信息如下:
  

The following packages have unmet dependencies:
libtiff5-dev : Depends: libjbig-dev but it is not going to be installed
Depends: libjpeg-dev
Depends: liblzma-dev but it is not going to be installed
Depends: libtiff5 (= 4.0.8-2+deb9u4) but 4.0.10-4 is to be installed
E: Unable to correct problems, you have held broken packages.

  
搞了一天才搞定,现在分享一下经验。
  

2.入坑第一课:切勿无脑换源

  
  真正的原因就是:你在刚开始的时候的源换的出了问题,这里拿清华的镜像源举例子:

  你的源是不是这样的:

http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

但是你注意看后面的stretch,你的系统版本是不是stretch呢??

命令行运行下面命令查看系统版本:
  

cat /etc/debian_version

  在这里插入图片描述
  
  
在这里插入图片描述

  
  然后跟上面对应,比如说我的是10.3,那我就把stretch改成buster,也就是把源更新为
  

http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi

http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi

    

在这里插入图片描述
  

系统源也是同理,怎么换源自行百度!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章