Jupyter notebooks all use latest version of Julia, even if marked as previous version

I just installed the latest version of Julia (1.8.1). I set it so that is the version that is run when I write “julia” in my terminal (I am on Ubuntu).

However, now when I open my previous (1.7.3) Julia notebooks, they all use version 1.81 (causing crashes). I create a new 1.7.3 notebook, and even if it is marked as 1.7.3, it still runs in version 1.8.1:

Is this even supposed to be possible? Does anyone know what might be going on?

That shouldn’t happen, but your Jupyter looks very different from mine so I’m not sure what’s going on. Here’s what I see in the menu bar at the top:

image

And choosing kernels works as expected.

Does your 1.7.3 kernel start the right julia binary?

You should have files for your jupyter kernels, perhaps in /home/user/.local/share/jupyter/kernels/.../kernel.json, that tell jupyter how to start the kernel.

My kernel.json file for my julia kernel contains

{
  "display_name": "Julia 1.7.2",
  "argv": [
    "/home/johan/Julia/julia-1.7.2/bin/julia",
    "-i",
    "--color=yes",
    "/home/johan/.julia/packages/IJulia/AQu2H/src/kernel.jl",
    "{connection_file}"
  ],
  "language": "julia",
  "env": {
    "JULIA_NUM_THREADS": "8"
  },
  "interrupt_mode": "signal"
}

which refers to a julia-executable /home/johan/Julia/julia-1.7.2/bin/julia.

If your kernel.json for the kernel that is named 1.7.3 refers to the correct binary file, then I do now know what might be the reason for your problem.

1 Like

Thanks a lot! Yes, this might explaion it. My 1.7 kernel.json says:

{
  "display_name": "Julia 1.7.3",
  "argv": [
    "/opt/julia/bin/julia",
    "-i",
    "--color=yes",
    "--project=@.",
    "/home/SLCU/torkel.loman/.julia/packages/IJulia/AQu2H/src/kernel.jl",
    "{connection_file}"
  ],
  "language": "julia",
  "env": {},
  "interrupt_mode": "signal"
}

where /opt/julia/bin/julia is where I put the julia binary on the new installation when I run “julia” in the terminal. Just manually changing this to somewhere where I have a julia 1.7.3 binary should solve it, right?

That sounds reasonable to me, but I have never tried that. I install several versions of julia and run IJulias installkernel from my julia-versions to let them install jupyter kernels.

1 Like