matlabでpythonモジュール(solve_ivp)を実行できない。
이전 댓글 표시
matlabでpythonモジュールを実行できず、エラーでmatlabが強制終了しました。
エラーを安全に回避する方法はありますか?
【実行環境】
・Windows 10
・MATLAB R2021a update 6(最新アップデート)
・Python 3.8.13 (Scipy 1.7.3をインストール)
matlabワークスペース上で以下を実行
py.test_func.hal
【python側】ファイル名:test_func.py
from scipy.integrate import solve_ivp
import numpy as np
def hal():
p_0 = 1.0; q_0 = 0.0
ini = [p_0,q_0]
tsp = [0.0,10.0]
tev = np.linspace(*tsp,100)
def halmc(t,x):
p,q = x
return [-q,p]
solv = solve_ivp(halmc,tsp,ini,method='RK45',t_eval=tev) #ここで強制終了
print(solv)
【エラー文】
MP: Error #15: Initializing libomp.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB の Python ライブラリ에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!