如何自动添加Jupyter(ipython)笔记本? [英] How to add automatically extension to Jupyter (ipython) notebook?
问题描述
我已经安装了扩展'calico-document-tools'
,我可以使用以下方式从Jupyter笔记本中加载:
I have installed extension 'calico-document-tools'
and I can load it from within Jupyter notebook using:
%%javascript
IPython.load_extensions('calico-document-tools');
如何为每个打开的笔记本自动加载它?
How can I load it automatically for each opened notebook?
我尝试添加 IPython.load_extensions('calico-document-tools');
或 IPython.load_extensions('C:/ Users /< username> /。ipython / nbextensions / calico-document-tools');
to C:\ Users \< username> \ .ipython \ profile_default\static\custom\custom.js
但它不起作用(扩展名应在工具栏上显示多个按钮)。
I tried adding IPython.load_extensions('calico-document-tools');
or IPython.load_extensions('C:/Users/<username>/.ipython/nbextensions/calico-document-tools');
to C:\Users\<username>\.ipython\profile_default\static\custom\custom.js
but it didn't work (extension should display a number of buttons on the toolbar).
我只有一个配置文件,使用 ipython配置文件创建
,Python 3.3,Windows 7创建。提前感谢。
I have only one profile, created with ipython profile create
, Python 3.3, Windows 7. Thanks in advance.
推荐答案
要安装扩展,我按照这款笔记本(暂不提供)。
To install the extensions I followed the instructions in this notebook (not available anymore).
我调整了一点以与ipython4兼容(其中n otebook服务器称为jupyter)。此命令全局安装扩展:
I adjusted them a little to be compatible with ipython4 (where the notebook server is called jupyter). This command installs the extension globally:
$ jupyter nbextension install https://github.com/Calysto/notebook-extensions/archive/master.zip
然后启用此扩展程序:
$ jupyter nbextension enable calico-document-tools
当您现在打开或重新加载笔记本时,它应该加载扩展名
When you now open or reload a notebook, it should load the extension
更新配置以启用扩展也可以从笔记本内部完成:
Updating the config to enable the extensions can also be done from inside the notebook:
%%javascript
IPython.notebook.config.update({
"load_extensions": {"calico-spell-check":true,
"calico-document-tools":true,
"calico-cell-tools":true
}
})
这篇关于如何自动添加Jupyter(ipython)笔记本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!