'fatal error' when installing h5py

725 views
Skip to first unread message

Grey Monroe

unread,
Jan 18, 2014, 10:46:05 AM1/18/14
to h5...@googlegroups.com
I am new to python, but would greatly appreciate someones advice about this error I have experienced when trying to install h5py.

After downloading and unarchiving the h5py-2.1.1.tar.gz, I type the following in Terminal:

$ cd h5py-2.1.1
$ python setup.py install

It does a bunch of stuff but then stops with this message:

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning
      "Using deprecated NumPy API, disable it by "          "#defining
      NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
 ^
In file included from h5py/defs.c:259:
h5py/api_compat.h:22:10: fatal error: 'hdf5.h' file not found
#include "hdf5.h"
         ^
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

I am running Python 2.7.6
If you need any other information I would be happy to share it.

Thank you,
Grey

Andrew Collette

unread,
Jan 18, 2014, 1:14:26 PM1/18/14
to h5...@googlegroups.com
Hi Grey,

>> In file included from h5py/defs.c:259:
>> h5py/api_compat.h:22:10: fatal error: 'hdf5.h' file not found
>> #include "hdf5.h"
>> ^
>> 1 warning and 1 error generated.
>> error: command '/usr/bin/clang' failed with exit status 1

This error means you need to install a development version of HDF5. I
see you're using clang, so I assume you're on a Mac. The best way to
install hdf5 on the mac is via homebrew or macports, although it can
be a little painful. Some of our other colleagues on this list might
be able to give you better advice, as I'm also new to the Mac
platform.

If you're really new to Python, a much easier way to get started would
be using one of the big free Python "distributions" for Mac. These
include packages like h5py, matplotlib, IPython, etc. already compiled
and ready to go. The "big two" are Anaconda and Enthought Python
Distribution. I personally use Anaconda for day-to-day analysis.

Andrew

Grey Monroe

unread,
Jan 19, 2014, 9:38:54 PM1/19/14
to h5...@googlegroups.com
Andrew,

Thank you very much. I have chosen to download Anaconda for it's simplicity. 

Yang Gao

unread,
Jun 15, 2015, 1:07:12 AM6/15/15
to h5...@googlegroups.com
Hi Andrew,

I have having the same problem when i am building against parallel HDF5:

$ export CC=mpicc
$ python setup.py configure --mpi
$ sudo python setup.py build

and I get

api_compat.h:27:10: fatal error: 'hdf5.h' file not found


Can I build with homebrew or macports, when i have to build against parallel HDF5? And what do you mean by "install a development version of HDF5" ?


Thanks,

Yang
Reply all
Reply to author
Forward
0 new messages