Error while trying to use matlab engine

15 Ansichten (letzte 30 Tage)
Arkaprava
Arkaprava am 6 Mai 2025
Bearbeitet: Harsh am 3 Jun. 2025
I am trying to install matlab engine on a conda environment in Fedora.
When I try to import matlab.engine on a jupyter notebook, I get the following error:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import matlab.engine
2 eng = matlab.engine.start_matlab()
File ~/anaconda3/envs/dbs2/lib/python3.10/site-packages/matlabengine-24.2-py3.10.egg/matlab/engine/__init__.py:82
79 secondExceptionMessage = str1 + str2
81 if secondExceptionMessage:
---> 82 raise EnvironmentError(secondExceptionMessage)
85 """
86 This lock can make sure the global variable _engines is updated correctly in
87 multi-thread use case. Also, it guarantees that only one MATLAB is launched
88 when connect_matlab() is called if there is no shared MATLAB session.
89 """
90 _engine_lock = threading.RLock()
OSError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance:
First issue: /home/arka/anaconda3/envs/dbs2/lib/python3.10/site-packages/zmq/backend/cython/../../../../.././libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/local/MATLAB/R2024b/extern/engines/python/dist/matlab/engine/glnxa64/../../../../../../../bin/glnxa64/libmwengine_api.so)
Second issue: /home/arka/anaconda3/envs/dbs2/lib/python3.10/site-packages/zmq/backend/cython/../../../../.././libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/local/MATLAB/R2024b/extern/engines/python/dist/matlab/engine/glnxa64/../../../../../../../bin/glnxa64/libmwengine_api.so)

Antworten (1)

Harsh
Harsh am 3 Jun. 2025
Bearbeitet: Harsh am 3 Jun. 2025
It seems "libmwengine_api" requires version symbols up to "GLIBCXX_3.4.30".
However, the "libstdc++" library included with the installed MATLAB R2024b does not provide "GLIBCXX_3.4.30". You can try running the following command in the linux console to check the "libstdc++" library versions featured with the MATLAB version installed in your machine.
$ strings /usr/local/MATLAB/R2024b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6 | grep
In order to resolve this issue, I would recommend you to reinstall reinstall MATLAB Engine for Python.
You can also try directing MATLAB to use the "libstdc++" library included with OS (Fedora 38 and Fedora 39 include "GLIBCXX_3.4.30") by setting an environment variable before starting MATLAB. Please refer to the following MATLAB Answers post for more information:
Please note that as MATLAB R2024b Update 6 comes with "GLIBCXX_3.4.30", this issue will be resolved if you simply upgrade to MATLAB R2024b Update 6.
I hope this helps, thanks!

Kategorien

Mehr zu Call MATLAB from Python finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by