Notebook cells hung up in VS Code

I’m just getting started with Julia in VS Code, and I’m running into an issue where notebook cells run for hours with the progress wheels spinning. Even this simple calculation seems to be too much for my computer to handle:

Any guesses on what I’m doing wrong here?

Could you check whether you are using a Jupyter kernel, or whether you are using the Julia VS Code extension to run code? In theory the latter should be less brittle because a lot less stuff is involved. In practice, well, who knows :wink:

In the kernel selector


make sure to select one of the entries that has Julia VS Code extension printed, like in the screenshot.

1 Like

Thanks for the speedy response. Forgive my ignorance here, but I’m not sure what is the difference is between the Jupyter kernel and the VS Code extension. It looks like Julia 1.7.2 is currently selected.

When you select one of the kernels with the “Julia VS Code extension” label, then all the code execution for the notebook is handled by the Julia VS Code extension. In particular, you don’t need to have IJulia.jl installed, or Jupyter or anything else, just Julia and the extension should be enough. It will also provide a tighter integration, for example there is a variable explorer etc.

Any of the other options will run code via IJulia.jl and the “standard” Jupyter kernel setup. There are are a lot more moving parts involved, and you need more things installed. At least in theory there shouldn’t be any benefit to going with this option.

In practice it seems that our Julia VS Code extension has some problem on your system… Can you start a REPL in VS Code with the Julia: Start REPL command?

Also, when you start a cell execution, can you check whether the Julia Workspace shows a kernel, like in this screenshot:

Yep, the Julia REPL’s working fine. But when I try to expand the Julia Notebook kernel in the folder, there doesn’t appear to be anything in there.

Screen Shot 2022-03-25 at 4.18.26 PM

Ok, one more idea: can you post here whether there is any output in this space:

I think if something crashes it should show up there…

Hmm, doesn’t even say Julia Kernel started... Should it say that?

Yes, if it doesn’t show that there is clearly some bug there… Looking at our code, though, it doesn’t really have any diagnostics that could help us narrow this down. We might have to add more diagnostic output and ship a new version of the extension to get to the bottom of this… I assume you haven’t gotten any crash report message, right?

@pfitzseb maybe you have another idea what could be going on here?

I haven’t gotten any crash messages. I wonder what’s going on, because I was able to execute cells a few days ago. But I’m new to Julia and VS Code, so it’s entirely possible that I messed something up.

Well, one of the goals of this way of running notebooks is that it should be so isolate from any configuration that it should always work, so I’m really eager to get to the bottom of this. I’m going to add a bit more diagnostic code, and we ship new versions of the extension every couple of days, so hopefully we’ll get a bit more info then.

1 Like

@chadagreene I just pushed a new release of the VS Code extension, version 1.6.10. Could you try again with that version? It should have more output in the Output->“Julia Notebook Kernels” thing, could you show what if anything it now shows?

Hmm just tried again, but the output’s still empty, and the Problems tab says “No problems have been detected in the workspace.” Could it be that the output remains empty because no cell ever finishes running?

Could you double check that you are on version 1.6.10 of the extension? Sometimes updates take a while.

@davidanthoff I see Julia v1.6.10, but on the same screen I see Julia 1.7.2. Is that the issue?


Screen Shot 2022-03-28 at 8.15.57 AM

That looks correct.

I have a PR that may or may not help with this issue (probably not – I got an explicit error message in the Julia Notebook Kernels output, as opposed to you).

I’ve added even more diagnostic output and will tag 1.6.11 in a moment. It will take 1-2 days before we can ship that on the release channel, but once that is out, I’ll ping you again and we can see whether we can get to the bottom of things then :slight_smile:

1 Like

Alright, we shipped 1.6.11, could you try again? Thanks so much for being patient with us on this diagnostic thing :slight_smile:

1 Like

@davidanthoff I’ve upgraded to v1.6.11, but the issue persists! The “Go To Running Cell” wheel spins forever, the Output tab remains blank, and the Problems tab says “No problems have been detected in the workspace.”

Ok, this is getting very mysterious :slight_smile: Couple more questions:

  • Can you let us know what version of Julia you have installed, what platform and how you installed it?
  • Do you have a startup.jl and if yes, is there anything in it?

I have to admit that I’m poking a bit in the dark now…

@davidanthoff Mysterious indeed.

The search feature on my Mac isn’t turning up any file called startup.jl, so I’m guessing I don’t have one.

As for the version of Julia, I wonder if I am running two different versions at once? Initially I thought these are two separate things, but now I am beginning to wonder, as they’re both called Julia, and they have similar version numbers.