本文介绍了导入h5py时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图导入h5py以读取此类文件.

I've been trying to import h5py to read this type of file.

这是我的代码:

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来获取此模块,并且不确定为什么它似乎无法正确安装.

I also used pip install h5py to get this module and am not sure why it did not seem install properly.

谢谢.

推荐答案

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

On Ubuntu. You can try the following three commands:

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

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

这篇关于导入h5py时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 14:29