update: it looks like this apprach does work on Windows, so it appears to be an OSX or unix-specific issue
Reading HDF5 with dynamic filters
15 views (last 30 days)
Show older comments
I am trying to read an HDF5 file that uses a zstd filter, and I am having trouble setting the HDF5_PLUGIN_PATH variable. Here is what I have tried:
>> !export HDF5_PLUGIN_PATH=/Users/bendichter/opt/miniconda3/lib/python3.9/site-packages/hdf5plugin/plugins
>> !echo $HDF5_PLUGIN_PATH
/Users/bendichter/opt/miniconda3/lib/python3.9/site-packages/hdf5plugin/plugins
>> setenv("HDF5_PLUGIN_PATH", "/Users/bendichter/opt/miniconda3/lib/python3.9/site-packages/hdf5plugin/plugins")
>> getenv("HDF5_PLUGIN_PATH")
'/Users/bendichter/opt/miniconda3/lib/python3.9/site-packages/hdf5plugin/plugins'
>> h5read("zstd.h5","/data")
Error using h5readc
The HDF5 library encountered an error and produced the following stack trace information:
H5PL__find_plugin_in_path can't open directory: /usr/local/hdf5/lib/plugin
Error in h5read (line 93)
[data,var_class] = h5readc(Filename,Dataset,start,count,stride);
Why is MATLAB looking in /usr/local/hdf5/lib/plugin? That directory does not exist, and I have tried two different ways to tell MATLAB to look an a different directory. What am I doing wrong?
4 Comments
Answers (1)
Ninad
on 19 Jan 2024
Hi Ben,
As per my understanding you want to read an HDF5 file in MATLAB and you are unable to set HDF5_PLUGIN_PATH variable using the "setenv()" function.
Please go through the latest version of MATLAB documentation "Import HDF5 Files":
It clearly states that you need to set the HDF5_PLUGIN_PATH environment variable to the folder containing the installed plugin binary file before you start MATLAB.
On Windows® — Set the environment variable using System Properties > Advanced > Environment Variables, and then start MATLAB.
Hope this helps.
Regards
Ninad
0 Comments
See Also
Categories
Find more on HDF5 in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!