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 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Ninad
2024-1-19
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 HDF5 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!