How to get rid of a zombie Matlab engine?

6 次查看(过去 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
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 CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by