开发者社区> 问答> 正文

Raspberry Pi和OpenCV无法安装libhdf5-100

我正在尝试降级并安装OpenCv需要安装的旧版本软件包。

因此,当我尝试安装它时,出现此错误:

pi@raspberrypi:~ $ sudo apt-get install libhdf5-100
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libhdf5-100 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libhdf5-103

E: Package 'libhdf5-100' has no installation candidate

我需要在103上安装libhdf5-100才能使opencv正确安装和运行。我正确安装了Opencv,但是在尝试导入时收到此错误。

(mypi) pi@raspberrypi:~ $ python
Python 3.5.4 (default, Sep  5 2017, 18:32:10) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/mypi/lib/python3.5/site-packages/cv2/__init__.py", line 3, in <module>
    from .cv2 import *
ImportError: libhdf5_serial.so.100: cannot open shared object file: No such file or directory
>>> exit()

如何解决此问题并安装100版本?

展开
收起
祖安文状元 2020-01-16 17:40:50 2060 0
1 条回答
写回答
取消 提交回答
  • 好的,我找到了解决方法。因此,您需要Buster才能升级到操作系统才能正常工作,然后从这里开始非常简单。

    首先,安装所需的所有依赖项。

    sudo apt-get update && sudo apt-get upgrade
    sudo apt-get install build-essential cmake pkg-config
    sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng-dev
    sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
    sudo apt-get install libxvidcore-dev libx264-dev
    sudo apt-get install libfontconfig1-dev libcairo2-dev
    sudo apt-get install libgdk-pixbuf2.0-dev libpango1.0-dev
    sudo apt-get install libgtk2.0-dev libgtk-3-dev
    sudo apt-get install libatlas-base-dev gfortran
    sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-103
    sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test python3-pyqt5
    sudo apt-get install python3-dev
    
    

    然后,您将使用python 3.7创建一个虚拟环境。在那之后,这是一个简单的pip命令来使其工作

    2020-01-16 17:40:58
    赞同 展开评论 打赏
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载