matlabengine install error(python)

7 ビュー (過去 30 日間)
龍馬 青葉
龍馬 青葉 2023 年 9 月 11 日
回答済み: Rushikesh 2024 年 9 月 20 日
I needed to call matlab from python, so I installed matlabengine in python and got the error shown in the picture. I did a lot of research and I can't get it to install. python version is 3.10 and matlab is R2023a.
Could you please tell me what to do?

回答 (1 件)

Rushikesh
Rushikesh 2024 年 9 月 20 日
The error you are encountering may be due to MATLAB R2023a not being in its default installation directory. To resolve this issue, you can add the MATLAB installation directory to the “LD_LIBRARY_PATH” environment variable on Linux systems. You can do this by adding the following line to your “.bashrc” file:
# in .bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<matlabroot>/bin/glnxa64
For macOS users, the environment variable name is DYLD_LIBRARY_PATH, and the path should be <matlabroot>/bin/maci64.
Additionally, installing the “matlabengine library via pip does not always guarantee a compatible version with MATLAB R2023a. It is recommended to download the MATLAB Engine version that is compatible with your MATLAB installation. Specifically, you can install MATLAB Engine version 9.14.7, which is known to be compatible with MATLAB R2023a, using the following command:
pip install matlabengine==9.14.7
For further guidance on identifying the compatible MATLAB Engine version for your installed MATLAB, as well as setting the LD_LIBRARY_PATH for your operating system, please refer to the documentation linked below. The perticular MATLAB Engine library release compatibility from 'Release history' section will provide additional details on appropriate version:
Hope this helps.

カテゴリ

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

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by