我正在尝试降级并安装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版本?
好的,我找到了解决方法。因此,您需要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命令来使其工作
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。