h5py Installation issue

1,513 views
Skip to first unread message

Kieran Short

unread,
Feb 26, 2015, 2:09:53 AM2/26/15
to h5...@googlegroups.com
Hi all,

Please be gentle!
I'm having issues trying to install h5py on a Win7/64 machine running Anaconda 2.1.0 (64-bit), Python 2.7.6. Numpy is version 1.9.0.
If I download the h5py installer (h5py-2.4.0.win32-py2.7.exe), as per installation instructions on http://www.h5py.org/ I think everything installs fine (no alerts or anything), but as soon as I try to import the h5py module, I get hit with:

ImportError: DLL load failed: %1 is not a valid Win32 application.
i.e.
============================
Python 2.7.6 |Anaconda 2.1.0 (64-bit)| (default, May 27 2014, 15:00:33) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
>>> import h5py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\kshort\AppData\Local\Continuum\Anaconda\lib\site-packages\h5py\__init__.py", line 10, in <module>
    from h5py import _errors
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>
============================

So there is some sort of incompatiblity, but I'm not sure where. Odd, as far as I can tell I've done everything I should as per: "Installing On Windows".

Anyway, I thought I'd just try and do a pip install instead, but that is also falling over:
pip install -U h5py
see attached h5py_pip.txt for the stdout
the fatality in the build is that it can't build the h5py.defs extension because hdf5.h cannot be found.

I'd like to be able to get h5py working, but I'm at a loss as to what the underlying issues are here.

Any help would be most appreciated.

cheers,
Kieran
h5py_pip.txt

Andrew Collette

unread,
Feb 26, 2015, 10:43:02 AM2/26/15
to h5...@googlegroups.com
Hi Kieran,

> I'm having issues trying to install h5py on a Win7/64 machine running
> Anaconda 2.1.0 (64-bit), Python 2.7.6. Numpy is version 1.9.0.

If you are using Anaconda, you should install the version of h5py
packaged by the Anaconda devs; e.g. "conda install h5py". The vanilla
Windows installers are unlikely to work; installing from source via
pip certainly won't work without a development copy of HDF5.

Andrew

Kieran Short

unread,
Feb 26, 2015, 5:29:18 PM2/26/15
to h5...@googlegroups.com
Thanks Andrew this works.

I've edited the windows installation instructions on GitHub and made a pull request, if it helps.

cheers,
Kieran
Reply all
Reply to author
Forward
0 new messages