Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error importing h5py

Tags:

python

h5py

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

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.

Thanks.

like image 648
Rodrigo Matus-Nicodemos Avatar asked Apr 23 '15 18:04

Rodrigo Matus-Nicodemos


2 Answers

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

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

like image 99
Mohamed Elsayed Avatar answered Sep 19 '22 15:09

Mohamed Elsayed


For windows you just need to install it normally using easy install feature:

pip install h5py

you can visit their website from here: H5py

like image 30
Karam Qusai Avatar answered Sep 20 '22 15:09

Karam Qusai