Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add automatically extension to Jupyter (ipython) notebook?

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?

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).

I have only one profile, created with ipython profile create, Python 3.3, Windows 7. Thanks in advance.

like image 897
Apogentus Avatar asked Aug 17 '15 08:08

Apogentus


People also ask

How do you add auto suggestions in Jupyter Notebook?

Enable autocomplete feature To enable code autocomplete in Jupyter Notebook or JupyterLab, you just need to hit the Tab key while writing code. Jupyter will suggest a few completion options. Navigate to the one you want with the arrow keys, and hit Enter to choose the suggestion.

How do I run a Jupyter Notebook script automatically?

This can be done by typing jupyter notebook in the terminal, which will open a browser. Then, navigate to the respective jupyter notebook file in the browser and open it. Click Cell > Run All on the toolbar. All done!


1 Answers

To install the extensions I followed the instructions in this notebook (not available anymore).

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

Then enable this extension:

$ 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
                     }
})
like image 143
Vasco Avatar answered Sep 22 '22 17:09

Vasco