matlab engine for python--systemerror from en.quit()
11 ビュー (過去 30 日間)
古いコメントを表示
Hello, When I try to execute eng.quit() using the matlab engine for python (which is overall nice), i get this annoying Python error: --------------------------------------------------------------------------- SystemError Traceback (most recent call last) /Applications/Canopy.app/appdata/canopy-1.4.1.1975.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where) 202 else: 203 filename = fname --> 204 _builtin_.execfile(filename, *where)
/Users/samuelheroy/kccperc_rods.py in module() 23 print('The time it takes to run this program is') 24 print(time.clock()-t0) ---> 25 eng.exit()
/Users/samuelheroy/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matlab/engine/matlabengine.pyc in exit(self) 244 """ 245 if self._matlab is not None: --> 246 pythonengine.closeMATLAB(self._matlab) 247 self.__dict__["_matlab"] = None 248
SystemError: MATLAB process can not be terminated.
It's not affecting my ability to run the code, but its presence in the output is rather annoying. Does anyone know why I'm getting this, or have a fix/workaround?
0 件のコメント
回答 (1 件)
Sarah Palfreyman
2014 年 10 月 29 日
Hi Sam,
Can you post your Python code?
Regarding the "SystemError: MATLAB process can not be terminated." is it possible that the engine was already stopped when you called quit()?
Quiting the MATLAB engine twice ...
>>> eng=matlab.engine.start_matlab() >>> eng.eval('exit', nargout=0) >>> eng.exit()
produces a very similar error message ...
matlabengine.py", line 246, in exit pythonengine.closeMATLAB(self._matlab) SystemError: MATLAB process can not be terminated.
1 件のコメント
sanlin ke
2023 年 8 月 25 日
編集済み: sanlin ke
2023 年 8 月 25 日
Hi, I'm having the same problem.
Exception ignored in: <function MatlabEngine.__del__ at 0x0000017B23790DC0>
Traceback (most recent call last):
File "C:\Python\Python39\lib\site-packages\matlab\engine\matlabengine.py", line 250, in __del__
self.exit()
File "C:\Python\Python39\lib\site-packages\matlab\engine\matlabengine.py", line 232, in exit
pythonengine.closeMATLAB(self.__dict__["_matlab"])
SystemError: MATLAB process cannot be terminated.
Could you help reply? Thanks!
参考
カテゴリ
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!