python - 导入 h5py 时出错

标签 python h5py

我一直在尝试导入 h5py 来读取这种类型的文件。

这是我的代码:

import h5py

file_1 = h5py.File("Out_fragment.h5py")

print file_1

输出是:

Traceback (most recent call last):
  File "./week11.py", line 17, in <module>
    import h5py
ImportError: No module named h5py

我也使用 pip install h5py 来获取这个模块,但我不确定为什么它似乎没有正确安装。

谢谢。

最佳答案

在 Ubuntu 上。您可以尝试以下三个命令:

  1. sudo pip install cython
  2. sudo apt-get install libhdf5-dev
  3. sudo pip install h5py

来源:https://github.com/fchollet/keras/issues/3426

关于python - 导入 h5py 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29831052/

相关文章:

python - 如何在 pywinauto 中移动 UIAWrapper 窗口?

python - 迭代 Pandas 系列

python - 是否可以从 Python 的 HDF5 文件中的复合数据集中读取字段名称?

python - 使用 h5py 以写入模式打开已打开的 hdf5 文件

python - 有没有办法在使用 Group.visititems 时获取数据集或组的父级?

python h5py : can I store a dataset which different columns have different types?

python - 使用 h5py 创建的 HDF5 文件无法通过 h5py 打开

python - Python 处理的输出的最佳数据结构是什么?

python - Graphene Django图像字段获取绝对路径

python - Redis - 用户名、密码和数据库?