Matlab 2023a python engine fails to start

12 ビュー (過去 30 日間)
Gustavo Silva
Gustavo Silva 2023 年 9 月 21 日
回答済み: Gagan Agarwal 2023 年 9 月 25 日
I've installed the python engine for Matlab2023a using the methods described in the documentation here
The installation messages claims success but, when I try to load the engine on a python terminal i get the following error:
Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matlab.engine
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/software/anaconda/2019.03/envs/gsilva/lib/python3.10/site-packages/matlab/__init__.py", line 218, in <module>
from matlabmultidimarrayforpython import double, single, uint8, int8, uint16, \
ImportError: /software/matlab/R2023a/extern/engines/python/../../../extern/bin/glnxa64/../../../sys/os/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
What should I do?

回答 (1 件)

Gagan Agarwal
Gagan Agarwal 2023 年 9 月 25 日
Hi Gustavo Silva,
I understand that you are trying to run the MATLAB engine directly from the Python terminal, but this is not possible. To use 'MATLAB engine' in Python, you need to create a Python script. Inside the script, you can import and start the 'MATLAB engine' using the following commands:
import matlab.engine
eng = matlab.engine.start_matlab()
You can execute the python script, by calling it from MATLAB using the 'pyrunfile' function.
For more information regarding 'pyrunfile', please refer to the following documentation: -
I 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