Can't open directory: /usr/local/hdf5/lib/plugin

Hi. I am trying to get data from a .h5 file. I get this error. Any idea? Thanks

data.value

/home/alexfm/anaconda2/bin/ipython:1: H5pyDeprecationWarning: dataset.value has been deprecated. Use dataset[()] instead.
#!/home/alexfm/anaconda2/bin/python
IOError Traceback (most recent call last)
in ()
----> 1 data.value
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
/home/alexfm/anaconda2/lib/python2.7/site-packages/h5py/_hl/dataset.pyc in value(self)
311 warn("dataset.value has been deprecated. "
312 “Use dataset[()] instead.”, H5pyDeprecationWarning, stacklevel=2)
–> 313 return self[()]
314
315 @property
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
/home/alexfm/anaconda2/lib/python2.7/site-packages/h5py/_hl/dataset.pyc in getitem(self, args)
571 mspace = h5s.create_simple(mshape)
572 fspace = selection.id
–> 573 self.id.read(mspace, fspace, arr, mtype, dxpl=self._dxpl)
574
575 # Patch up the output for NumPy

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5d.pyx in h5py.h5d.DatasetID.read()
h5py/_proxy.pyx in h5py._proxy.dset_rw()
h5py/_proxy.pyx in h5py._proxy.H5PY_H5Dread()

IOError: Can’t read data (can’t open directory: /usr/local/hdf5/lib/plugin)

You can customize the location where HDF5 is looking for plugins (shared libraries) via the HDF5_PLUGIN_PATH environment variable. If that variable is not set /usr/local/hdf5/lib/plugin is the default plugin path, which appears to be absent on your system.

G.

1 Like

Setting the environment variable HDF5_PLUGIN_PATH can be an unreliable method of addressing this issue due to the underlying implementation, especially on Windows systems.

On Windows systems, there are multiple C standard libraries (mscrt and ucrt) and sometimes multiple copies of these C standard libraries, each have their own environment variable structures. The HDF Group HDF5 library implementation currently interfaces with the environment through the C standard library. An alternative on Windows would be for the HDF5 library to use GetEnvironmentVariable via kernel32.

https://bugs.python.org/issue39406

To bypass potential operating specific issues I highly recommend using the H5PL function family such as H5PLappend:
https://docs.hdfgroup.org/hdf5/develop/group___h5_p_l.html#gac74200fdc02f794f3fae753fe8b850b0

These are accessible through Python’s h5py low-level interface:
https://api.h5py.org/h5pl.html

The PDF file at the following link contains more information on “HDF5 Dynamically Loaded Filters” for background:
https://portal.hdfgroup.org/display/HDF5/HDF5+Dynamically+Loaded+Filters

1 Like

If you are using h5py to access the data, you can try to use hdf5plugin to see if this fixes the issue (version 2.0 as you are still using Python 2).

pip install hdf5plugin~=2.0

and then in your code:

import h5py
import hdf5plugin

<your code>

Try to move to Python 3 at some point :wink: