Using Jupyter Notebook extensions

You can open Jupyter Notebook by running jupyter notebook, or by opening Anaconda Navigator and clicking the Jupyter Notebook icon.


With Anaconda you can download and install 4 extensions for the Jupyter Notebook which make the notebook easier to use:

  • RISE
  • Notebook Anaconda Cloud (nb_anacondacloud)
  • Notebook Conda (nb_conda)
  • Notebook Conda Kernels (nb_conda_kernels)

Installing any of the 4 installs all of them. The _nb_ext_conf package is also installed, which activates the extensions.

Obtaining the extensions

To get the extensions using Anaconda Navigator:

  1. Install and manage notebook extensions packages like any other packages. See Navigator user guide.
  2. To use the new extensions, on the Navigator Home tab, open Jupyter Notebook.

To install all Jupyter Notebook extensions from the command line, run:

conda install nb_conda

Note

These extensions were already installed in Anaconda versions 4.1 and 4.2. If you have Anaconda v4.1 or v4.2 installed, there is no need to install them separately. To begin using them, open a new or existing notebook.

Uninstalling the extensions

To remove all Jupyter Notebook extensions, run:

conda remove nb_conda

Uninstalling nb_conda or any other 1 of the 4 extensions uninstalls all 4.

To disable Jupyter Notebook extensions individually without uninstalling them, run:

python -m nb_conda_kernels.install --disable --prefix=<ENV_PREFIX>

jupyter-nbextension disable nb_conda --py --sys-prefix
jupyter-serverextension disable nb_conda --py --sys-prefix

jupyter-nbextension disable nb_anacondacloud --py --sys-prefix
jupyter-serverextension disable nb_anacondacloud --py --sys-prefix

jupyter-nbextension disable nbpresent --py --sys-prefix
jupyter-serverextension disable nbpresent --py --sys-prefix

Note

Replace <ENV_PREFIX> with your root environment or another conda environment where the extensions have been installed.

RISE

You can access the install instructions for the RISE extension from Anaconda Cloud.

In-depth documentation can be found there as well.

Notebook Anaconda Cloud

You must have an Anaconda Cloud account for this extension to work. You can sign up for a free account at Anaconda Cloud.

  1. You can upload your notebook to your Cloud account with a simple button push:

    ../../../../_images/nb-ext-acloud1.png

    You can use the Attach conda environment option described below to embed a copy of your conda environment as an environment.yaml file in the notebook metadata.

  2. Sign in to Cloud:

    • If you are not signed in to Cloud, a dialog box appears asking for your Cloud username and password.

    • You may instead log in at the command line:

      anaconda login
      

      Note

      This is recommended if you do not have a secure connection.

  3. Open Jupyter Notebook, then open the notebook you wish to upload to Cloud.

  4. In the top navigation bar, click the Publish to Anaconda Cloud button:

    ../../../../_images/nb-ext-acloud1.png

  5. In the dialog box that appears, select your username.

  6. Type a description of the notebook for display on Cloud:

    ../../../../_images/nb-ext-acloud4.png

  7. If you want the identical environment to be included when the notebook is downloaded and opened, select the Attach conda environment checkbox.

  8. Click the Publish button.

  9. After publishing, you can view the notebook or play the presentation on Cloud from the top navigation bar by clicking the Cloud button:

    ../../../../_images/nb-ext-acloud6.png

Your notebook on Anaconda Cloud will look similar to this one:

../../../../_images/nb-ext-acloud5.png

For more information on Cloud, see Anaconda Cloud.

Notebook conda

This extension provides conda environment and package access from within Jupyter Notebook.

To manage all environments:

  1. While viewing the dashboard file manager, select the Conda tab, which shows your current conda environments:

    ../../../../_images/nb-ext-conda1.png

    Note

    To add a new conda environment, click the + button above the environments list on the right side.

  2. Select an environment by clicking its name.

  3. In the package management section that displays, the icons from left to right have the following meanings:

    • Search for packages in your current environment.
    • Refresh your packages list.
    • Update selected packages.
    • Remove selected packages.
    ../../../../_images/nb-ext-conda3.png

To manage the current kernel environment, in the Kernel menu, select Conda Packages, which displays a list of conda packages in the current environment:

../../../../_images/nb-ext-conda2.png

For more information on using and managing conda packages, see Managing packages.

Notebook Conda Kernels

This extension allows you to use conda environment-based kernels from the dashboard and the notebook’s Kernel menu. It makes the notebook aware of your conda environments, and it is required for Notebook Anaconda Cloud and Notebook Conda.

When creating a new notebook on the Files tab, you can pick any of the Python or R language kernels in any of your environments:

../../../../_images/nb-ext-kernel1.png

You can also change to those kernels on a current notebook:

../../../../_images/nb-ext-kernel2.png