registering kernels in ipython/jupyter notebook - kernel.json

亡梦爱人 提交于 2021-02-07 02:58:57

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/28442624/registering-kernels-in-ipython-jupyter-notebook-kernel-json

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!