pydata

Keep Looking, Don't Settle

install jupyter notebook extension

Installation

1. Install the python package

pip install jupyter_contrib_nbextensions

or download first, and then install

git clone https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git

pip install -e jupyter_contrib_nbextensions

2. Install javascript and css files

This step copies the nbextensions' javascript and css files into the jupyter server's search directory, and edits some jupyter config files. A jupyter subcommand is provided for the purpose:

jupyter contrib nbextension install --user

The command does two things: installs nbextension files, and edits nbconvert config files. The first part is essentially a wrapper around the notebook-provided jupyter nbextension install, and copies relevant javascript and css files to the appropriate jupyter data directory. The second part edits the config files jupyter_nbconvert_config.jsonand jupyter_notebook_config.json as noted below in the options. The command can take most of the same options as the jupyter-provided versions, including

  • --user to install into the user's home jupyter directories
  • --system to perform installation into system-wide jupyter directories
  • --sys-prefix to install into python's sys.prefix, useful for instance in virtual environments, such as with conda
  • --symlink to symlink the nbextensions rather than copying each file (recommended, on non-Windows platforms).
  • --debug, for more-verbose output

3. Enabling/Disabling extensions

To use an nbextension, you'll also need to enable it, which tells the notebook interface to load it. To do this, you can use a Jupyter subcommand:

jupyter nbextension enable <nbextension require path>

for example,

jupyter nbextension enable codefolding/main

To disable the extension again, use

jupyter nbextension disable <nbextension require path>

Alternatively, and more conveniently, you can use the jupyter_nbextensions_configurator server extension:

Installing the pip package. This should be as simple as

pip install jupyter_nbextensions_configurator

Configuring the notebook server to load the server extension. A jupyter subcommand is provided for this. You can enable the serverextension and the configurator nbextensions listed below for the current user with

jupyter nbextensions_configurator enable --user

IMAGE ALT TEXT HERE

Reference

  1. Jupyter notebook extensions

  2. Jupyter Nbextensions Configurator