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

How to use MATLABKernel from a VSCode devcontainer? #24

Open worc4021 opened 1 year ago

worc4021 commented 1 year ago

Hello guys!

Not so much an issue but more a question: Has anyone been able to get the jupyter kernel embedded in vscode via a devcontainer?

My attempts so far have been futile and I keep seeing

Kernel needs to be started by a Jupyter Server. Please use JupyterLab or Classic Notebook while using MATLAB Kernel for Jupyter.

Anything I am missing in princple? It works in the lab and in the notebook but refuses to connect in vscode :'(

Cheers, Manuel

codingToPerfection commented 1 year ago

same issue here. I think it is possible for matlab proxy working in vscode-jupyter environment.

I use vscode-jupyter to launch matlab kernal.

It returns :

Kernel needs to be started by a Jupyter Server. Please use JupyterLab or Classic Notebook while using MATLAB Kernel for Jupyter.
vani-lu commented 1 year ago

My current workaround is to open the jupyter server from command line. Copy and paste the url into VSCode as "existing Jupyter Server" as guided here.

codingToPerfection commented 1 year ago

My current workaround is to open the jupyter server from command line. Copy and paste the url into VSCode as "existing Jupyter Server" as guided here.

I have not tried your method. But I think it will work.

NickSebClark commented 1 year ago

vani-lu's workaound works just fine for me.

It would be nice if we could skip this step.

andresxvar commented 1 year ago

My current workaround is to open the jupyter server from command line. Copy and paste the url into VSCode as "existing Jupyter Server" as guided here.

hi, did "jupyter variables" panel work for you? The matlab code runs, but the panel doesn't show any variables. Not sure if this is a vscode issue or jupyter-matlab-proxy issue.

prabhakk-mw commented 1 year ago

@andresxvar Would you please create another issue to track this question / feature request?

Idiotabtcodes commented 6 months ago

Really appreciate your work here. But there's been a hiccup with it in my end. In vscode, when I install and activate the official MATLAB extension, I get problems roughly translated as "cannot run code anlysis, '~\Untitled1.ipynb' invald file extension name" from every cell. I can still run the codes as expected when connected to MATLAB Kernal, though.

And if I disable the MATLAB extension and reopen the file, matlab lauguage is not recognised and features like syntax highlightening are gone while the "plain text" code works fine. I notice that there's a MATLAB icon named Objective-C in select language mode, it can highlight sytax but not auto complete code.

prabhakk-mw commented 6 months ago

Hi @Idiotabtcodes

disable the MATLAB extension and reopen the file, matlab lauguage is not recognised and features like syntax highlightening are gone while the "plain text" code works fine. I notice that there's a MATLAB icon named Objective-C in select language mode, it can highlight sytax but not auto complete code.

This is a known limitation of with the Linter being used by the MATLAB extension for VSCode. Currently the linter only recognizes files which have M or MLX extensions .

For now, I'd recommend leaving the extension turned on and ignoring these warnings.

The issue has been captured here: https://github.com/mathworks/MATLAB-extension-for-vscode/issues/88

Idiotabtcodes commented 6 months ago

Thanks for the quick response! I suppose I can live with this.