gpt4 book ai didi

linux - 树莓派和OpenCV无法安装libhdf5-100

转载 作者:行者123 更新时间:2023-12-02 16:14:57 26 4
gpt4 key购买 nike

我正在尝试降级并安装 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

我需要 libhdf5-100 而不是 103,以便 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 版本?

最佳答案

好的,我找到了解决方法。因此,您需要 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 命令让它工作

pip install opencv-contrib-python==4.1.0.25

我希望这能帮助遇到困难的人。旧方法不再有效,所以我浪费了一天的时间。

关于linux - 树莓派和OpenCV无法安装libhdf5-100,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59080094/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com