在ipython/jupyter笔记本中注册内核-kernel.json [英] registering kernels in ipython/jupyter notebook - kernel.json

查看:289
本文介绍了在ipython/jupyter笔记本中注册内核-kernel.json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用最新版本的IPython,可以通过将kernel.json文件放置在~/.ipython/kernels/<kernel-name>/中来注册内核.

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

我目前正在尝试添加juliaR内核,我想知道谁负责创建和维护这些kernel.json文件.

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.

目前,我手动搜索并创建了针对茱莉亚的kernel.json以下文件:

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"
}

尽管这可行,但由于kernel.jl的硬编码路径,我将不得不为每次julia重大升级采用kernel.json.

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?

推荐答案

通常,人们创建符号链接以避免依赖特定版本.

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

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

然后可以在kernel.json中使用latest代替v0.3.

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.

这篇关于在ipython/jupyter笔记本中注册内核-kernel.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆