Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF error in the presence of h5py #694

Closed
sfinkens opened this issue Jul 14, 2017 · 2 comments
Closed

HDF error in the presence of h5py #694

sfinkens opened this issue Jul 14, 2017 · 2 comments

Comments

@sfinkens
Copy link

sfinkens commented Jul 14, 2017

If h5py is imported before netCDF4 on my system, reading a netCDF4 file fails with the following error:

>>> import h5py
>>> import netCDF4
>>> nc = netCDF4.Dataset('test.nc', 'r')
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "netCDF4/_netCDF4.pyx", line 1873, in netCDF4._netCDF4.Dataset.__init__ (netCDF4/_netCDF4.c:13842)
    File "netCDF4/_netCDF4.pyx", line 1579, in netCDF4._netCDF4._ensure_nc_success (netCDF4/_netCDF4.c:12628)
IOError: NetCDF: HDF error

If you swap the imports or omit the h5py import, everything works fine. Maybe this is related to #653 ? I'm using netCDF4-1.2.8 and h5py-2.7.0 linked against netCDF-4.4.1.1 with hdf5 support (hdf5-1.8.18). The modules were installed using pip, the Python version is 2.7.13, system is CentOS-7.3.

@jswhit
Copy link
Collaborator

jswhit commented Jul 14, 2017

This must depend on how the modules are built and installed, since I cannot reproduce this on macos x with git master h5py and netcdf4-python, and HDF5 1.10.0-patch1.

@sfinkens
Copy link
Author

Thanks for the hint! As it turned out, the modules were not linked against the local netCDF4/hdf5 libraries, but the wheels installed by pip come with their own version of the libraries which seem to be incompatible. Building the modules from source and linking against the local netCDF4/hdf5 libraries solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants