Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

registering kernels in ipython/jupyter notebook - kernel.json

With the latest version of IPython, kernels can be registered by placing a kernel.json file in ~/.ipython/kernels/<kernel-name>/.

I am currently trying to add a julia and a R kernel and I am wondering who is responsible for creating and maintaining those kernel.json files.

Currently, I googled and created following kernel.json for julia by hand:

{
 "display_name": "Julia",
 "language": "julia",
 "argv": [
    "julia",
    "-i",
    "-F",
    "/User/<user>/.julia/v0.3/IJulia/src/kernel.jl",
    "{connection_file}"
 ],
 "codemirror_mode":"julia"
}

While this works, due the hardcoded path to kernel.jl I will have to adapt kernel.json for every major julia upgrade.

Do I have to take care of creating and maintaining these files? Or are they part of the kernel implementations or other third party packages?

like image 377
cel Avatar asked Feb 10 '15 21:02

cel


1 Answers

Usually people create symbolic links to avoid depending on specific versions.

ln -s ~/.julia/v0.3 ~/.julia/latest

then you could use latest instead of v0.3 in kernel.json.

When you change versions you will only have to change the symbolic link.

like image 125
anthonybell Avatar answered Nov 04 '22 16:11

anthonybell