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
282 stars 36 forks source link

auth token won't be set automatically. #94

Closed HappySpring closed 3 months ago

HappySpring commented 3 months ago

After upgrading from v0.11 to v0.12.2, I foudn that I have to fill the auth token manually according to the output from jupyter-matlab-proxy, as shown below:

image

Previous, this token will be filled automatically upon opening Matlab from Jupiter. Do you have any ideas on what may cause the requirement for manual token input and how to configure jupyter-matlab-proxy to automatically fill in the auth token again?

krisctl commented 3 months ago

Dear @HappySpring!

This issue seems to be stemming from version mismatch between jupyter-matlab-proxy and its dependency matlab-proxy.

Could you please upgrade these packages using the command :

pip install --upgrade jupyter-matlab-proxy matlab-proxy

and verify that the upgrade went through using commands like:

pip list | Select-String "matlab-proxy" in PowerShell or pip list | grep "matlab-proxy" on Linux.

If you are seeing the issue even after upgrading the packages, please run the troubleshooting script located here and share the output of the troubleshooting script.

Hope that helps!

HappySpring commented 3 months ago

I have solved this problem. I am using jupyter-matlab-proxy in a tricky environment. This is what happened.

The jupiter was launched by "/path/to/conda1/bin/jupyter lab ....“ in a docker container. Upon the startup, the .bashrc in my home dir outside of the container is executed, which activated another conda (/path/to/my/home/anaconda/bin/conda) with python of a different version. I guess this setup caused all commands executed via the "open matlab" to run in a conda environment separate from the JupyterLab instance.

To fix this problem, I modified the container to launch JupyterLab from the same Conda environment (/path/to/my/home/anaconda/bin/conda). And the matlab works great again!