Installing Julia as a Jupyter kernel with IJulia

As I’ve found myself doing this a lot recently, here’s quick capture on how to get the wonderful IJulia configured properly:

import Pkg
Pkg.add("IJulia")

import IJulia
IJulia.installkernel("Julia", "--project=@.", env=Dict("JULIA_DEBUG" => "Main"))

Which will install a kernelspec to your default Jupyter kernel installation directory. For me (under Ubuntu 22.04), that’s ~/.local/share/jupyter/kernels.