如何自动添加Jupyter(ipython)笔记本? [英] How to add automatically extension to Jupyter (ipython) notebook?

查看:225
本文介绍了如何自动添加Jupyter(ipython)笔记本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了扩展'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屋!

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