Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get matlab to work with Jupyter #39

Closed
dfosterhill opened this issue Jun 27, 2023 · 4 comments
Closed

Can't get matlab to work with Jupyter #39

dfosterhill opened this issue Jun 27, 2023 · 4 comments
Assignees
Labels
answered Issue has been answered no response

Comments

@dfosterhill
Copy link

Hello.

Have tried to follow the instructions at the repo. Same with these here: http://jmlilly.net/jupyter-matlab. Matlab is indeed on my path. I have done the install of jupyter-matlab-proxy. If I then launch jupyter lab, the matlab option does not show up. If I instead launch jupyter notebook, and select 'new' from the dropdown at right, I see three matlab options:

If I pick 'kernel' I get a 'creating notebook failed' window with a large red 'forbidden' rectangle. The same happens with the other two matlab options.

Running Monterey on a m1 Mac.

Dave.

@krisctl krisctl self-assigned this Jul 2, 2023
@prabhakk-mw prabhakk-mw added the bug Something isn't working label Jul 3, 2023
@otavo
Copy link

otavo commented Jul 11, 2023

I have the same issue on Windows, "Error connecting to MATLAB. Check the status of MATLAB by clicking the "Open MATLAB" button. Retry after ensuring MATLAB is running successfully"

Does work with Anaconda y Jupyter 3.x

Python 3.x y jupyter 4.x Its Works!!!

@krisctl
Copy link
Member

krisctl commented Jul 11, 2023

Hello @dfosterhill,

Thank you for trying out jupyter-matlab-proxy!

  1. The issue described as "The large red 'forbidden' rectangle" is related to an upstream issue with Jupyter Notebooks. More information related to this is described in NotebookApp Error unpacking user from cookie jupyter/notebook#6702.

To workaround this issue, one could:

Use Jupyter Lab instead of Jupyter Notebook as shown below:

jupyter lab

If Jupyter Lab is not usable in your environment, one could also downgrade the version of jupyter-server as suggested in jupyter/notebook#6702 as follows:

pip install --upgrade 'jupyter-server<2.0.0'
  1. To diagnose the issue related to the MATLAB Kernel or Open MATLAB icons not showing on your Jupyter Lab interface, would you please try the steps mentioned in the troubleshooting guide, especially the section with the headline as
    If the integration is not showing up as an option to the dropdown box in the Jupyter notebook:

If the suggested solutions in the troubleshooting guide don’t work, then please share the output for the below commands:

# list the python environment
which python pip

 
# list the version of python & pip
python --version
pip --version


# list the packages installed 
python -m pip list | grep -E "jupyter|matlab-proxy|jupyter-matlab-proxy|notebook"


# list the jupyter executable
which jupyter

 
# list the matlab-proxy-app on path
which matlab-proxy-app

 
# list whether the server extensions are enabled
jupyter serverextension list

 
jupyter nbextension list


jupyter labextension list

 

It is sometimes possible that the Jupyter Lab environment requires one to explicitly activate extensions for use with Jupyter Lab, one can do it from the interface as shown below. After making these changes, be sure to restart jupyter lab to verify that they have taken effect.

image

  1. Finally, you also mention seeing 3 MATLAB options under New. Could you please share a screen shot showcasing this? It might be possible that the python environment that jupyter was launched from has multiple packages related to community kernels installed? Ideally, if one only has jupyter-matlab-proxy installed, then one should only see the following options under New:

image

  1. I use the following commands to create a fresh environment with the integration installed properly:
conda create -n freshEnv python=3.10 -y

conda activate freshEnv

python -m pip install jupyter-matlab-proxy jupyterlab

# This reloads the environment to pick up the changes to your environment
conda activate freshEnv


# ensure that the freshly installed executables are picked up by running which again:
which jupyter matlab-proxy-app


# Example output on my machine:
# /home/user/miniconda3/envs/freshEnv/bin/jupyter
# /home/user/miniconda3/envs/freshEnv/bin/matlab-proxy-app

I hope this information helps fix these issues.
Please do let me know if I can be of further assistance!

@krisctl krisctl added answered Issue has been answered waiting for response and removed bug Something isn't working labels Jul 11, 2023
@prabhakk-mw
Copy link
Member

@otavo

My guess is that MATLAB is occasionally taking longer to start in that environment.
Could you please check the logs that are printed on the terminal to verify that MATLAB has started and has completed its startup sequence ?

You will see the MATLAB >> prompt on the terminal output when MATLAB has completed its startup sequence

Retrying the execution of the notebook cell after MATLAB has completed its startup sequence should resolve the error message.

PS: As of jupyter-matlab-proxy version 0.5.4 we increased this timeout to 120 seconds.
If you are seeing this message before that time and are on a version of the proxy thats newer than 0.5.4 , please do create another issue to continue the investigation.

Thank you!

@krisctl
Copy link
Member

krisctl commented Aug 18, 2023

Please feel free to create a new issue if this behavior is still observed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Issue has been answered no response
Projects
None yet
Development

No branches or pull requests

4 participants