[SciPy-User] opening a hdf5 file using h5py

Bala subramanian bala.biophysics at gmail.com
Sat Jun 18 12:06:25 EDT 2011


The file do exist. First i tried by giving f=h5py.File('*eg.hdf*'). Then
when i got the error i renamed the file to *eg.hdf5*. In either case the
error was the same.

Yes,i am able to write h5py.File('eg.hdf5','w') -- this mode works but read
mode throws the error i pasted.

On Sat, Jun 18, 2011 at 5:44 PM, Darren Dale <dsdale24 at gmail.com> wrote:

> Or, you are trying to read a file that does exist, but the hdf5
> library does not recognize the file's format as hdf5.
>
> On Sat, Jun 18, 2011 at 11:33 AM, Robin M Baur <rmb62 at cornell.edu> wrote:
> > The h5py list is over here: https://groups.google.com/group/h5py
> >
> > That said, it looks like you're trying to read a file that doesn't
> > exist. Does f = h5py.File('eg.hdf5', 'w') work?
> >
> > Robin
> >
> > On Sat, Jun 18, 2011 at 11:28, Bala subramanian
> > <bala.biophysics at gmail.com> wrote:
> >> Friends,
> >> I am a newbie to using hdf5 files. I need to work on hdf5 format file.
> To do
> >> this, i installed h5py and numpy (in fedora 14) and to make sure if it
> >> works, I tried to open a hdf5 format file using the following code as
> given
> >> in the example section of h5py home page.
> >>
> >> #!/usr/bin/env python
> >> import h5py
> >> f=h5py.File('eg.hdf5','r')
> >>
> >> I am getting the following error. Someone kindly write me what is the
> >> problem here. I tried to google the error but i am not understanding
> what is
> >> going wrong.
> >>
> >> Traceback (most recent call last):
> >>   File "test.py", line 4, in <module>
> >>     f=h5py.File('eg.hdf5','r')
> >>   File
> >>
> "/usr/lib64/python2.7/site-packages/h5py-1.3.1-py2.7-linux-x86_64.egg/h5py/highlevel.py",
> >> line 797, in __init__
> >>     self.fid = self._generate_fid(name, mode, plist)
> >>   File
> >>
> "/usr/lib64/python2.7/site-packages/h5py-1.3.1-py2.7-linux-x86_64.egg/h5py/highlevel.py",
> >> line 831, in _generate_fid
> >>     fid = h5f.open(name, h5f.ACC_RDONLY, fapl=plist)
> >>   File "h5f.pyx", line 68, in h5py.h5f.open (h5py/h5f.c:1268)
> >> h5py.h5e.LowLevelIOError: Unable to find a valid file signature
> (Low-level
> >> I/O: Unable to initialize object)
> >>
> >>
> >> _______________________________________________
> >> SciPy-User mailing list
> >> SciPy-User at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/scipy-user
> >>
> >>
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User at scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> >
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110618/61261186/attachment.html>


More information about the SciPy-User mailing list