问题
I have attempted to install the netCDF4 module several times now and I keep getting the same error:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\Users\User\AppData\Local\Temp\pycharm-packaging0.tmp\netCDF4\setup.py", line 219, in <module>
raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers
I tried using the official HDF installer from their website and I am still getting the same error (though during the installation the setup warned me that the PATH is too long and so it will not alter it.
Where do these header files need to be? At the moment I (think) have them in
C:\Program Files\HDF_Group\HDF5
I am not really familiar with what I need to do? If it matters I have also installed the h5py module.
(Windows 8.1)
回答1:
You need to create a file setup.cfg
in the base of source tree (you can base it on the setup.cfg.template
that should be there). Specifically, you'll want to set the value of HDF5_dir
within the file.
来源:https://stackoverflow.com/questions/28931204/hdf5-headers-missing-in-installation-of-netcdf4-module-for-python