I need to start MATLAB in Python using MATLAB Engine API for Python
as www-data with GUI/as desktop app. And the following code results in the error:
import matlab.engine
eng = matlab.engine.start_matlab()
eng.desktop(nargout=0)
When I try to run this code, the -desktop
argument is just ignored and Matlab runs like -nodesktop
.
import matlab.engine
eng = matlab.engine.start_matlab('-desktop')
Error: desktop is not supported because: Swing is not currently available.
How to make it run?