Matlab 2023a python engine fails to start
9 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
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!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Call MATLAB from Python についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!