Connect REPL to jupyter notebook kernel

I am using the jupyter notebook Julia extension for VS Code and find it quite nice. However, when debugging my commands I often find myself reproducing my notebook steps in a script and then run them in a REPL to be able to toy around with the objects in workspace.

While the objects of the Julia Notebook are also listed on the right in the “Workspace” tile, there is no way to interact with them except for the notebook itself. Is there any way I could “attach” a REPL to the Notebook workspace?

You could try out GitHub - c42f/RemoteREPL.jl: Connect a REPL to a remote Julia process.

This works, thanks a lot! It would be a cool feature for the extension to have right off the bat, I’ll probably file a feature request, as soon as I find out where this should go. The Jupyter extension or the Julia extension?

Depends on whether you use an IJulia kernel or the built in notebook support of the Julia VSCode plugin I suppose.

1 Like

The latter, I believe. I wasn’t aware there are several ways to use notebooks in VSCode. Is there a tutorial for integrating IJulia somewhere?

If you’ve just got the VSCode jupyter extension (language agnostic) and IJulia installed, you should be able to select the IJulia kernels in VSCode.

I haven’t tried it in a while and these things move fast, but I believe using a “native” kernel from the VSCode Julia extension is the recommended way of going about this, although IJulia does have some benefits (it works the same as in the browser so is more tightly coupled with the Julia REPL session than the VSCode extension, like autocompletion of DataFrame column names)

Actually having just written the above I tried it out and it seems like that autocompletion doesn’t work anymore, even with an IJulia kernel? Which is odd as I’d always thought IJulia works the same in a browser and VSCode…

Anyway now that I’ve installed it all I can at least show you what I meant with selecting kernels above. Here’s what things look like with both the jupyter and Julia extensions installed in VSCode:

image

So the Julia VSCode extension has picked up all my installed Julia versions (at least those in a similar location, older Julia versions are not in \Local\Programs so are missed out), while the top four kernels are those listed in my jupyter configuration file (which gets updated if you do ]build IJulia or IJullia.installkernel() in a REPL session)

it would be amazing if we could debug jupyter by attaching a repl and using infiltrate in the repl.