mathworks / jupyter-matlab-proxy

MATLAB Integration for Jupyter enables you to run MATLAB code in Jupyter Notebooks and other Jupyter environments. You can also open MATLAB in a browser directly from your Jupyter environment to use more MATLAB features.
Other
283 stars 36 forks source link

MATLAB session fails to start on jupyter notebook. #14

Closed wibox closed 2 years ago

wibox commented 2 years ago

After selecting a new MATLAB session from the dropdown menu, the terminal shows the following log in loop:

Traceback (most recent call last): File "/home/francesco/Desktop/unvenv/bin/matlab-proxy-app", line 8, in sys.exit(main()) File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/matlab_proxy/app.py", line 575, in main loop.run_until_complete(runner.setup()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/aiohttp/web_runner.py", line 279, in setup self._server = await self._make_server() File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/aiohttp/web_runner.py", line 375, in _make_server await self._app.startup() File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/aiohttp/web_app.py", line 417, in startup await self.on_startup.send(self) File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/aiosignal/init.py", line 36, in send await receiver(*args, **kwargs) # type: ignore File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/matlab_proxy/app.py", line 490, in start_background_tasks await matlab_starter(app) File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/matlab_proxy/app.py", line 476, in matlab_starter await state.start_matlab() File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/matlab_proxy/app_state.py", line 485, in start_matlab xvfb, display_port = await mw.create_xvfb_process(xvfb_cmd, dpipe, matlab_env) File "/home/francesco/Desktop/unvenv/lib/python3.8/site-packages/matlab_proxy/util/mw.py", line 283, in create_xvfb_process xvfb = await asyncio.create_subprocess_exec( File "/usr/lib/python3.8/asyncio/subprocess.py", line 236, in create_subprocess_exec transport, protocol = await loop.subprocess_exec( File "/usr/lib/python3.8/asyncio/base_events.py", line 1630, in subprocess_exec transport = await self._make_subprocess_transport( File "/usr/lib/python3.8/asyncio/unix_events.py", line 197, in _make_subprocess_transport transp = _UnixSubprocessTransport(self, protocol, args, shell, File "/usr/lib/python3.8/asyncio/base_subprocess.py", line 36, in init self._start(args=args, shell=shell, stdin=stdin, stdout=stdout, File "/usr/lib/python3.8/asyncio/unix_events.py", line 789, in _start self._proc = subprocess.Popen( File "/usr/lib/python3.8/subprocess.py", line 858, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'Xvfb' INFO:MATLABProxyApp:Environment variable MWI_CUSTOM_HTTP_HEADERS is not set, hence no custom HTTP headers are applied. INFO:MATLABProxyApp:Successfully validated provided jupyter configuration INFO:MATLABProxyApp:Found cached licensing information... INFO:charset_normalizer:Detected declarative mark in sequence. Priority +1 given for utf_8. INFO:charset_normalizer:utf_8 passed initial chaos probing. Mean measured chaos is 0.000000 % INFO:charset_normalizer:We detected language [('English', 1.0), ('French', 1.0), ('Dutch', 1.0), ('Swedish', 1.0), ('Indonesian', 1.0)] using utf_8 INFO:charset_normalizer:utf_8 is most likely the one. Stopping the process. INFO:MATLABProxyApp:Saving licensing information... INFO:MATLABProxyApp:Successful re-use of cached information. INFO:MATLABProxyApp:MATLAB_LOG_DIR:/tmp/MWI/31511 INFO:MATLABProxyApp:MATLAB_READY_FILE:/tmp/MWI/31511/connector.securePort

I've followed the instructions and made sure python, jupyter and matlab-proxy-app are in the same folder (under the same virtual environment) and that matlab is in PATH.

diningPhilosopher64 commented 2 years ago

Hi @wibox,

Thank you for trying the MATLAB Jupyter integration.

From this line in the logs:

FileNotFoundError: [Errno 2] No such file or directory: 'Xvfb'

This means Xvfb was not installed on the machine from which the integration is launched.

To install Xvfb:

# On a Debian/Ubuntu based system:
sudo apt install Xvfb
# On a RHEL based system:
sudo yum install Xvfb

For a complete list of requirements, check matlab-proxy requirements and jupyter-server-proxy requirements

Thanks, Sourabh.