如何解决ImportError:libhdf5_serial.so.103:无法打开共享对象文件:导入h5py时没有这样的文件或目录

问题描述 投票:0回答:1

我对Linux平台和Raspberry Pi相当陌生。我基本上是用Tensorflow做一个ML项目。因此,为了保存模型,我使用了[[h5py库。尽管我在安装该库时没有问题,但是在Python 3.7中将其导入时却遇到了巨大的导入错误]

我用它来下载pip3 install h5py

这是我运行代码后显示的导入错误-File "<stdin>", line 1, in <module> File "/home/pi/.local/lib/python3.7/site-packages/h5py/__init__.py", line 26, in <module> from . import _errors ImportError: libhdf5_serial.so.103: cannot open shared object file: No such file or directory 因此,看到此错误后,我在互联网上进行了很多搜索,但没有任何帮助。我尝试了thisthisthis甚至this

我也安装了sudo apt-get update sudo apt-get install libhdf5-dev sudo apt-get update sudo apt-get install libhdf5-serial-dev

但是似乎没有任何作用。我该怎么办?

顺便说一句,我使用了Raspberry Pi 3B +,Python 3.7和Raspbian。

python linux importerror hdf5 h5py
1个回答
0
投票
当在树莓派零上安装numpy时,我也遇到了类似的问题,我可以通过解决方法解决此问题>]

    以pip卸载库
  1. 使用apt-get安装库:sudo apt-get install python3-h5py
  2. 似乎只使用apt-get安装库而不先卸载它是行不通的。
© www.soinside.com 2019 - 2024. All rights reserved.