anacondajuliajupyter

How to add latest Julia version to Jupyter Notebook


I installed Julia 1.5.3 on my Linux Mint 20 system. I copied the Julia files in julia-1.5.3-linux-x86_64.tar.gz to /opt/julia-1.5.3/, adjacent to the folder /opt/julia-1.4.1/, (I did not change the path environment variable in .bashrc).

I ran Pkg.add("IJulia")in the Julia console.

So far so good, the new version runs if I start Julia from the command prompt. Atom / Juno also run the latest version.

But, if I run Jupyter from the Anaconda navigator, then I only see the older version of Julia, see this picture: https://i.sstatic.net/ZG1TH.png

How can I add julia-1.5.3 to that menu?


Solution

  • If you did not install IJulia, the Julia package which runs the jupyter kernel, that's what you're missing.

    If you've got that already but you have updated your Julia version and can only see the old Julia kernel, You need to Pkg.build("IJulia") or ] build IJulia in pkg repl mode as the build script registers the kernel.

    In addition to running the build script there's also an installkernel function exported by IJulia which gives you more control over what type of kernel you want to add to Jupyter. As an example, a multithreaded kernel can be added like this:

    installkernel("Julia (4 threads)", env = Dict("JULIA_NUM_THREADS" => "4"))
    

    Here the first argument is the kernel name which will be displayed in the Jupyter GUI, and the Dict sets the environment variable needed to start a multi-threaded Julia process.