gpt4 book ai didi

python - 如何自动为 Jupyter (ipython) notebook 添加扩展?

转载 作者:太空狗 更新时间:2023-10-30 00:49:13 25 4
gpt4 key购买 nike

我已经安装了扩展 'calico-document-tools'我可以使用以下方法从 Jupyter Notebook 中加载它:

%%javascript
IPython.load_extensions('calico-document-tools');

如何为每个打开的笔记本自动加载它?

我尝试添加 IPython.load_extensions('calico-document-tools');IPython.load_extensions('C:/Users/<username>/.ipython/nbextensions/calico-document-tools');C:\Users\<username>\.ipython\profile_default\static\custom\custom.js但它没有用(扩展应该在工具栏上显示一些按钮)。

我只有一个配置文件,是用 ipython profile create 创建的, Python 3.3, Windows 7。提前致谢。

最佳答案

为了安装扩展,我按照 this notebook 中的说明进行操作(不再可用)。

我对它们进行了一些调整以兼容 ipython4(其中笔记本服务器称为 jupyter)。此命令全局安装扩展:

$ jupyter nbextension install https://github.com/Calysto/notebook-extensions/archive/master.zip

然后启用这个扩展:

$ jupyter nbextension enable calico-document-tools

当您现在打开或重新加载笔记本时,它应该加载扩展

更新配置以启用扩展也可以在笔记本内部完成:

%%javascript
IPython.notebook.config.update({
"load_extensions": {"calico-spell-check":true,
"calico-document-tools":true,
"calico-cell-tools":true
}
})

关于python - 如何自动为 Jupyter (ipython) notebook 添加扩展?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32046241/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com