How to get rid of a zombie Matlab engine?
조회 수: 8 (최근 30일)
이전 댓글 표시
While starting a named shared Matlab engine in R2018b, I got the following error:
Error using matlab.engine.shareEngine (line 41)
MATLAB session 'MATLABEngineX' already exists. Current MATLAB session is now shared with default name 'MATLAB_5960'.
I am using this engine from python, who actually does not see the MATLABEngineX session, only the new MATLAB_5960. The former session was indeed not closed properly and apparently turned into a zombie session.
I did not find any question regarding this issue and it took me quite some time to find out how to solve it: there is a zero-byte file in C:\Temp with the name of the engine that apparently serves as a marker for Matlab (but not for python). Manually removing this file resolved the issue.
I don't understand why Matlab needs this marker if python does not, but it would be good to include a hint in the error message. For example:
MATLAB session 'MATLABEngineX' already exists (if this is due to a session not being closed properly, remove the file C:\Temp\MATLABEngineX).
댓글 수: 1
Csaba
2022년 8월 24일
A session name file may be stuck in the tempdir.
Check it here:
>> tempdir
If there is an empty file with the engine name, delete it and restart Matlab.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!