What is the appropriate workflow for running Jupyter Notebookes in VSCode with IJulia

So it is technically possible to run a Julia Jupyter notebook in VSCode without getting IJulia involved. However, this tends to get very buggy and I have been told that I should still get IJulia involved.

What is actually the exact workflow for doing this? I.e. I think I am supposed to create a kernel using IJulia in my console, and then connect to that through VSCode when I star the notebook. I am unsure how to do this.

I have tried to add IJulia to the environment, then run it in the VSCode console using

using IJulia

However, even if I then also run

notebook()

no specific kernel seems to show up when I start my notebook.

Also, do I need to add IJulia to the environment of the notebook, or can I set up the kernel anywhere?

There’s nothing to be done especially as far as I’m aware. I just have IJulia in my global environment, and then in VSCode I can do:

(top right corner) and then

Clicking on “Jupyter Kernels” gives:

which are my IJulia kernels, and they just work :tm:

3 Likes

There is also JupyterLab + code-server + Julia.

You may test it at https://demo.jupyter.b-data.ch/.
→ Resources are limited to 2 cores and 8 GB RAM.

Based on

  1. Containerised Jupyter deployment
  2. JupyterLab Julia docker images

1 Like

code-server = Code - OSS in the browser.

1 Like

I tried just adding IJulia to my global environment, then running using IJulia, then closing Julia. However, when I then start VSCode and try to select a Kernel, nothing like that is available.

You need make a kernel first with IJulia.installkernel. Afterwards they are in the “jupyter kernel…” list. I recommend adding some threads to the kernel

1 Like

I tried

julia> using IJulia
julia> IJulia.installkernel("Julia Test Kernel")
[ Info: Installing 'Julia Test Kernel 1.11.5' kernelspec in /home/loman/.local/share/jupyter/kernels/julia-test-kernel-1.11
"/home/loman/.local/share/jupyter/kernels/julia-test-kernel-1.11"

In my console, before starting VSCode and trying to select a kernel. Unfortunatley, the new one does not show up :frowning:

I think your screenshot is from after you clicked on “Julia” already in the “Select kernel” menu?

In any event upon further reflection I think you do need the Jupyter extension for VSCode for this to work.

2 Likes

Thanks a lot @nilshg, with this I got it all to work nicely!

2 Likes