3
votes

I am using Windows 7 and Python 2.7.9. I tried to install h5py with pip, but have the following error:

[c:\users\dell\appdata\local\temp\pip-build-j2msd9\h5py\h5py\api_compat.h(27) : fatal error C1083: cannot open include file:“hdf5.h”: No such file or directory

error: command 'd:\visual studio 2008\VC\BIN\amd64\cl.exe' failed with exit status 2

http://i.stack.imgur.com/N3VO8.jpg


things I have tried:

  1. Reinstall Visual Studio 2008 compiler
  2. installed some necessary modules such as modHDF5 and numpy
2

2 Answers

0
votes

The error you are getting is because you have not installed HDF5, or you have not specified the directory that HDF5 has been installed into.

The simplest thing to do, is to try to install h5py with a modern pip which supports wheels (e.g. run python.exe -m pip install -U pip, and then try reinstalling h5py).

If you want to build from source on Windows, see http://docs.h5py.org/en/latest/build.html#source-installation-on-windows, but I strongly recommend using wheels on Windows (as the person who wrote said CI scripts).

0
votes

I changed the version of h5py to 2.9.0 and it worked like a charm Please check what version is installed along with Pre-built package.