Skip to content

Commit 1faa06f

Browse files
krisctlPrabhakar Kumar
authored andcommitted
Introduces a script to troubleshoot installation & configuration issues with jupyter-matlab-proxy.
1 parent 65968cb commit 1faa06f

File tree

3 files changed

+589
-79
lines changed

3 files changed

+589
-79
lines changed

troubleshooting.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

troubleshooting/troubleshooting.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Troubleshooting guide for MATLAB Integration _for Jupyter_
2+
We have provided a Python script, troubleshooting.py, which runs basic environment checks to determine if the required dependencies are met or not. This script does not send the information anywhere remotely and just relays information to the terminal window.
3+
4+
5+
## Table of Contents
6+
1. [Requirements](#requirements)
7+
2. [Running the script](#running-the-script)
8+
9+
## Requirements
10+
* Python
11+
12+
## Running the script
13+
One can run the latest version of the troubleshooting script using the following command:
14+
15+
```bash
16+
$ curl https://raw.githubusercontent.com/mathworks/jupyter-matlab-proxy/main/troubleshooting/troubleshooting.py | python -
17+
```
18+
19+
Ensure that the `python` executable used to run this script is from the same environment in which you intend to use the integration.
20+
21+
Also, if you are on a platform that doesn't support `curl`, please consider downloading the [troubleshooting.py](https://raw.githubusercontent.com/mathworks/jupyter-matlab-proxy/main/troubleshooting/troubleshooting.py) and running it as:
22+
23+
```bash
24+
$ python troubleshooting.py
25+
```
26+
27+
Alternatively, you can manually execute the below commands in the environment where you have installed the package:
28+
29+
* Verify that the MATLAB executable is on the PATH
30+
```bash
31+
$ which matlab
32+
/usr/local/bin/matlab
33+
```
34+
35+
* Check if the Python version is 3.8 or higher
36+
```bash
37+
$ python --version
38+
Python 3.8.3
39+
```
40+
41+
* Ensure that `matlab-proxy-app` and the `jupyter` executables are in the same environment as the Python executable.
42+
For example, if you are using VENV to manage your Python environments:
43+
```bash
44+
$ which python
45+
/home/user/my-project/packages/.venv/bin/python
46+
47+
$ which matlab-proxy-app
48+
/home/user/my-project/packages/.venv/bin/matlab-proxy-app
49+
50+
$ which jupyter
51+
/home/user/my-project/packages/.venv/bin/jupyter
52+
```
53+
Notice that `matlab-proxy-app`, `jupyter` and the `python` executable are in the same parent directory, in this case, it is: `/home/user/my-project/packages/.venv/bin`
54+
55+
* Ensure that you are launching `jupyter lab` using the same executable listed above.
56+
57+
* Ensure that all three packages are installed in the same Python environment
58+
```bash
59+
# Pipe the output of pip freeze and grep for jupyter, matlab-proxy and jupyter-matlab-proxy.
60+
# All three packages should be highlighted in the output.
61+
# If you don't see any one of them, then either the packages missing in the output have been installed
62+
# in a different Python environment or not installed at all.
63+
$ pip freeze | grep -E "jupyter|matlab-proxy|jupyter-matlab-proxy"
64+
```
65+
66+
* If the integration is not a visible option in the dropdown box inside the Jupyter Notebook:
67+
```bash
68+
#Run the following commands and verify that you are able to see similar output:
69+
70+
$ jupyter serverextension list
71+
config dir: /home/user/anaconda3/etc/jupyter
72+
jupyter_server_proxy enabled
73+
- Validating...
74+
jupyter_server_proxy OK
75+
jupyterlab enabled
76+
- Validating...
77+
jupyterlab 3.5.1 OK
78+
79+
$ jupyter nbextension list
80+
Known nbextensions:
81+
config dir: /home/user/anaconda3/etc/jupyter/nbconfig
82+
notebook section
83+
jupyter-js-widgets/extension enabled
84+
- Validating: OK
85+
tree section
86+
jupyter_server_proxy/tree enabled
87+
- Validating: OK $ pip freeze | grep -E "jupyter|matlab-proxy|jupyter-matlab-proxy"
88+
89+
$ jupyter labextension list
90+
jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
91+
jupyter_matlab_labextension v0.1.0 enabled OK
92+
@jupyterlab/server-proxy v3.2.2 enabled OK
93+
94+
95+
# IF the server does not show up in the commands above, install:
96+
$ pip install jupyter-contrib-nbextensions
97+
```
98+
99+
----
100+
101+
Copyright 2023 The MathWorks, Inc.
102+
103+
----

0 commit comments

Comments
 (0)