简体   繁体   English

导入h5py时出错

[英]Error importing h5py

I've been trying to import h5py to read this type of file. 我一直在尝试导入h5py来读取这种类型的文件。

Here is my code: 这是我的代码:

import h5py

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

print file_1

The output is: 输出是:

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

I also used pip install h5py to get this module and am not sure why it did not seem install properly. 我也使用pip install h5py来获取这个模块,我不确定为什么它似乎没有正确安装。

Thanks. 谢谢。

On Ubuntu. 在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

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

For windows you just need to install it normally using easy install feature: 对于Windows,您只需使用简易安装功能正常安装它:

pip install h5py

you can visit their website from here: H5py 你可以从这里访问他们的网站: H5py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM