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

MATLAB Login problems persist #105

Open
GlascherLab opened this issue Nov 20, 2024 · 3 comments
Open

MATLAB Login problems persist #105

GlascherLab opened this issue Nov 20, 2024 · 3 comments
Assignees
Labels
answered Issue has been answered bug Something isn't working question Further information is requested waiting for response

Comments

@GlascherLab
Copy link

Summary

I have installed a miniconda python setup on a Macbookd Pro (Apple M3 Silicon chipset) and a MATLAB R2024b installed and added to my system path. Following this descriptions, I ran

cd /Applications/MATLAB_R2024b.app/extern/engines/python/; python setup.py install

and then ued miniconda's pip to install jupyter-matlab-proxy and jupyterlab

pip install jupyter-matlab-proxy; pip install jupyterlab

When I choose the MATLAB kernel in the Laucher, I get to the MATLAB login page, where I entered my credentials using the Online License Manager for individaul licenses. I then get

Error connecting to MATLAB. Check the status of MATLAB by clicking the "Open MATLAB" button. Retry after ensuring MATLAB is running successfully

when I enter any command. Clicking on "Open MATLAB" I see

Status: not running
Licensing: Online LIcense Manager (login name)
Authenticated (wiht a green chekcmark)
Error: Online Licence Manager failed
Error Codes:
License Manager Error 4410
License Manager Error 4410
Invalid security token. (Status code: Unauthorized)

Any hints on how to solve this isseu would be highly appreciated.

Thanks.

PS: The throbleshooting scripts alerts me that Python is not installed. However, I rand the script with miniconda Python as well as with my other homebrew Python installation. Not sure if this is somehow related ...

Browser(s) used

Chrome

Issue found in

MATLAB Kernel

Script output

17:28 $ python troubleshooting.py


                                                                   MATLAB

matlab - /Applications/MATLAB_R2024b.app/bin/matlab OK


                                                              matlab-proxy-app

matlab-proxy-app - /opt/homebrew/bin/matlab-proxy-app OK


                                                                  Jupyter

jupyter - /opt/homebrew/bin/jupyter OK


                                                         Python and pip executables

python - None X
Recommendation: python is not installed. Please install python.

pip - /opt/homebrew/bin/pip OK

pip 24.3.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)

python3 - /opt/homebrew/bin/python3 OK

Python 3.11.10


                                                               OS information

Darwin
23.5.0
macOS-14.5-arm64-arm-64bit
uname_result(system='Darwin', node='synapse.local', release='23.5.0', version='Darwin Kernel Version 23.5.0: Wed May 1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030', machine='arm64')


                                                             Conda information

conda - None


                                                             Installed packages

/bin/sh: python: command not found


                                                         Jupyter server extensions

Config dir: /Users/glaescher/.jupyter

Config dir: /opt/homebrew/Cellar/jupyterlab/4.3.1/libexec/etc/jupyter
jupyter_lsp enabled
- Validating jupyter_lsp...
jupyter_lsp 2.2.5 OK
jupyter_server_terminals enabled
- Validating jupyter_server_terminals...
jupyter_server_terminals 0.5.3 OK
jupyterlab enabled
- Validating jupyterlab...
jupyterlab 4.3.1 OK
notebook enabled
- Validating notebook...
notebook 7.0.7 OK
notebook_shim enabled
- Validating notebook_shim...
notebook_shim OK

Config dir: /usr/local/etc/jupyter

JupyterLab v4.3.1
/opt/homebrew/Cellar/jupyterlab/4.3.1/libexec/share/jupyter/labextensions
jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
@jupyter-notebook/lab-extension v7.0.7 enabled OK


                                                           Environment variables

@GlascherLab GlascherLab added bug Something isn't working needs-triage labels Nov 20, 2024
@prabhakk-mw
Copy link
Member

Hi @GlascherLab

4410 usually implies that your MathWorks account is not linked to the MATLAB release that's attempting to start with those credentials.

I'll look deeper into this when i get in to office tomorrow, but in mean time could you please try the following

  • start MATLAB from your terminal using

matlab -licmode online

And login using the same credentials?

Does MATLAB start?

  • Could you try using the jupyter integration with an older version of MATLAB? Say 24a?

Make sure you update the path to point to 24a after installing it, if you are trying this out.

Finally two more pointers:

  1. MATLAB can now be installed using the MATLAB package manager (mpm)

See https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/MPM.md

  1. One doesn't need to install the MATLAB engine for python to use the jupyter integration as shown in the stack overflow answer.
    You could install it only if you need to use it.

The install steps listed in the main README of this repo should be the only thing you need to do to have this working on any platform.

Thank you for trying the MATLAB integration for Jupyter!

@GlascherLab
Copy link
Author

GlascherLab commented Nov 20, 2024 via email

@krisctl
Copy link
Member

krisctl commented Nov 29, 2024

Dear Jan (@GlascherLab),

The issue which you are seeing seems to be coming from Jupyter not registering MATLAB Kernel from the correct path. We can follow below steps to get it to a working state.

  1. Let's first ensure that homebrew's python is on path. For example, below is the output of running echo $PATH on my terminal.

/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/opt/[email protected]/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

  1. Since MATLAB Kernel uses python3 command to start the kernel, let's also link python3 to the correct homebrew python by doing:

ln -sf /opt/homebrew/bin/python3.11 /opt/homebrew/bin/python3

We would verify that the above was successful by running which python3 and observing that it returns

/opt/homebrew/bin/python3

  1. Install required packages

/opt/homebrew/bin/python3 -m pip install --no-cache-dir jupyterlab
/opt/homebrew/bin/python3 -m pip install --no-cache-dir jupyter-matlab-proxy

  1. So that Jupyter is able to register MATLAB Kernel, we need to point the Jupyter path to the location where MATLAB Kernel's spec file is present by adding below to the .zshrc or .bash_profile (depending upon shell)

export JUPYTER_PATH="/opt/homebrew/share/jupyter"

  1. For MATLAB Kernel to work correctly, we also need to enable a server extension by running:

/opt/homebrew/bin/jupyter server extension enable --py jupyter_server_proxy --sys-prefix

  1. Finally we start Jupyterlab with the correct app-dir set:

/opt/homebrew/bin/jupyter-lab --app-dir=/opt/homebrew/share/jupyter/lab

This hopefully gets you to a place where you are able to see MATLAB Kernel as well as Open MATLAB tiles in the Jupyterlab launcher interface. Please let me know if this doesn't solve the issue with the system-wide Python and other packages.

Regards,
Krishan

@krisctl krisctl added question Further information is requested answered Issue has been answered waiting for response labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Issue has been answered bug Something isn't working question Further information is requested waiting for response
Projects
None yet
Development

No branches or pull requests

3 participants