在ipython/jupyter笔记本中注册内核-kernel.json [英] registering kernels in ipython/jupyter notebook - 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>/
.
我目前正在尝试添加julia
和R
内核,我想知道谁负责创建和维护这些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屋!