Getting h5py error for python

20 ビュー (過去 30 日間)
faran
faran 2021 年 8 月 9 日
コメント済み: Yongjian Feng 2022 年 2 月 22 日
I am trying to load h5py module in matlab and I am getting this error:
Error using h5>init h5py.h5 (line 1)
Python Error: ImportError: DLL load failed: The specified procedure could not be found.
I installed the versio 3.2.1 of this package through python but can not load it in matlab. Anyone can help in this?

回答 (1 件)

Yongjian Feng
Yongjian Feng 2021 年 8 月 11 日
  1. Make sure you can use h5py in python first.
  2. Check where it is installed. Then use setenv inside matlab to set the env var PYTHONPATH to point to that location.
  4 件のコメント
AsukaIkeda
AsukaIkeda 2022 年 2 月 22 日
@Yongjian Feng Thank you for the answer, and sorry I didn't notice your comment.
I tried your command inside matlab. But it still didn't work.
This is my matlab setup.
getenv('PYTHONPATH')
ans = 'C:\Users\(my user name)\anaconda3\envs\tf37\lib\site-packages\h5py'
However, I found the another solution.
I copied the following DLL files
from "C:\Users\(my user name)\anaconda3\envs\tf37\Library\bin"
to "C:\Users\(my user name)\anaconda3\envs\tf37\Lib\site-packages\h5py" .
cilkrts20.dll
concrt140.dll
hdf5.dll
hdf5_cpp.dll
hdf5_hl.dll
hdf5_hl_cpp.dll
hdf5_tools.dll
ifdlg100.dll
libchkp.dll
libicaf.dll
libifcoremd.dll
libifcorert.dll
libifportmd.dll
libirngmd.dll
libmmd.dll
libmpx.dll
msvcp140.dll
svml_dispmd.dll
szip.dll
vcruntime140.dll
zlib.dll
for numpy, I also made the following settings.
Yongjian Feng
Yongjian Feng 2022 年 2 月 22 日
I see. Matlab can find the python package, but has trouble to find the dependent dll. Maybe you can set the PATH env var to point to those dll.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by