天天看點

【樹莓派入坑指南系列】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

  

【樹莓派入坑指南系列】Raspberry Pi 4B樹莓派安裝opencv安裝依賴libtiff5總是失敗?震驚:這一招能填平你在安裝依賴時候的坑!!!

  

  

【樹莓派入坑指南系列】Raspberry Pi 4B樹莓派安裝opencv安裝依賴libtiff5總是失敗?震驚:這一招能填平你在安裝依賴時候的坑!!!

  

  然後跟上面對應,比如說我的是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
           

    

【樹莓派入坑指南系列】Raspberry Pi 4B樹莓派安裝opencv安裝依賴libtiff5總是失敗?震驚:這一招能填平你在安裝依賴時候的坑!!!

  

系統源也是同理,怎麼換源自行百度!

繼續閱讀