Calling Mex File inside a Matlab Engine Call from Python, matlab.engine.EngineError: MATLAB function cannot be evaluated, SystemError: MATLAB process cannot be terminated
Show older comments
I have an imaging pipeline that is in Python, this pipelline needs to call a scripts Matlab doing wavelet filtering. However the Matlab code I have is calling some compiled C code. I know it seems completely absurd but for now I have to go this way.
Is it possible to call a C mex file through Matlab called by python with the Matlab engine?
Thanks.
Here is the full error message I get:
File "/PATH/TO/PYTHON/Script.py", line 93, in <module>
piw_reslice(s['pet'], 6, 1, 24)
File "/PATH/TO/PYTHON/module.py", line 14, in piw_reslice
nargout=0)
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/matlabengine.py", line 71, in __call__
_stderr, feval=True).result()
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/futureresult.py", line 67, in result
return self.__future.result(timeout)
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/fevalfuture.py", line 82, in result
self._result = pythonengine.getFEvalResult(self._future,self._nargout, None, out=self._out, err=self._err)
matlab.engine.EngineError: MATLAB function cannot be evaluated
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/__init__.py", line 193, in __exit_engines
eng().exit()
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/matlabengine.py", line 232, in exit
pythonengine.closeMATLAB(self.__dict__["_matlab"])
SystemError: MATLAB process cannot be terminated.
4 Comments
dylan Lee
on 21 Jul 2020
hello, do you solve this problem. i have the same problem, can you please help me.
Arya YAZDAN PANAH
on 21 Jul 2020
dylan Lee
on 23 Jul 2020
Tharks for your answer。I have slove this problem by sharing this matlab session with python.
晨曦 刘
on 25 Sep 2020
I also have this question, can you please tell me how do you share the matlab session with python?
Answers (0)
Categories
Find more on Call MATLAB from Python in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!