IntelliJ IDEA 2021.1 Help

Jupyter notebook support

With Jupyter Notebook integration available in IntelliJ IDEA through the Python plugin, you can easily edit, execute, and debug notebook source code and examine execution outputs including stream data, images, and other media.

Notebook support in IntelliJ IDEA includes:

  • Editing and preview:

    • Ability to present a notebook as source code with textual cell definitions and manipulate cells as regular code.

    • Live preview of the cell execution output and Markdown content.

    • Auto-saving changes that you make in your files. Saving is triggered by various events, for example, closing a file or a project, or quitting the IDE.

  • Coding assistance:

  • Ability to run cells and preview execution results.

  • Dedicated Jupyter Notebook Debugger.

  • Shortcuts for basic operations with Jupyter notebooks.

  • Ability to recognize .ipynb files and mark them with the ipynb file icon icon.

Quick start with the Jupyter notebook in IntelliJ IDEA

To start working with Jupyter notebooks in IntelliJ IDEA:

  1. Create a new project, specify a virtual environment, and install the jupyter package.

  2. Open or create an .ipynb file.

  3. Add and edit source cells.

  4. Execute any of the code cells to launch the Jupyter server.

  5. Analyze execution results in the Preview pane.

Get familiar with the user interface

Mind the following user interface features when working with Jupyter notebooks in IntelliJ IDEA.

Notebook editor

In IntelliJ IDEA, you can work with Jupyter notebook files using three viewing modes:

In this mode, you can add notebook cells and edit them.

Editor only mode

In this mode, you can both edit cells and preview their output. This is the default viewing mode for Jupyter notebooks in IntelliJ IDEA.

Editor and preview mode

In this mode, you can preview markdown and raw cells as well as code cell execution results.

Preview only mode

Editing and preview modes reflect the currently selected IntelliJ IDEA user interface appearance.

Notebook toolbar

The Jupyter notebook toolbar provides quick access to all basic operations with notebooks:

Jupyter toolbar
Jupyter Quick List

Opens the Jupyter Quick List for easy access to the basic notebook operations:

  • Run Cell: Executes the current cell.

  • Run All Above: Executes all cells above excluding the current cell.

  • Run All Below: Executes the current cell and all cells below.

  • Run Cell and Select Below: Executes the current cell and navigates to the below cell ( ).

  • Debug Cell: Starts the debugging session for the current cell (Alt + Shift + Enter for Windows or ⌥⇧↩ for macOS).

  • Add Code Cell Above: Adds a new code cell above the current cell (Alt + Shift + A for Windows or ⌥ ⇧ A for macOS).

  • Add Code Cell Below: Adds a new code cell below the current cell (Alt + Shift + B for Windows or ⌥ ⇧ B for macOS).

  • Select Cell Above: Selects the cell above the current cell.

  • Select Cell Below: Selects the cell below the current cell.

  • Clear Outputs: Erases all execution output in the Preview area.

  • Start Jupyter Server: Launches the Jupyter server.

  • Stop Jupyter Server: Stops the Jupyter notebook.

  • Configure Shortcuts: Opens the Settings/Preferences | Keymap | Python dialog to alter the default keymaps.

Run all cellsExecutes all cells in the notebook.
Interrupt the kernelClick this icon if you want to interrupt any cell execution.
Restart the kernelClick this icon to restart the currently running kernel
Datalore iconUpload to Datalore/Update uploaded notebook. Enables sharing the selected Jupyter notebook using Datalore, an intelligent web application for data analysis. Click this button to start sharing the current notebook file. Once you modify the notebook file, this button enables updating the shared notebook in Datalore.
List of Jupyter serversThe Jupyter Server widget that shows the currently used Jupyter server. Click the widget and select Configure Jupyter Server to setup another local or remote Jupyter server.
List of Jupyter kernelsList of the available Jupyter kernels.
Trusted JS widgetsSelect this checkbox to allow executing JavaScript in your Jupyter notebook.
Move the cell upThis actions moves the current cell up.
Move the cell downThis actions moves the current cell down.
Open notebook in browserYou can preview the notebook in a browser.
Scroll from sourceEnables auto scrolling from the source cell in the Editor to the corresponding output in the Preview pane.
Scroll to sourceEnables auto scrolling from the cell output in the Preview pane to the corresponding source cell in the Editor.
Show sources in previewClick this icon to show source code fragments in the Preview pane.
Editor only viewing modeClick this icon to switch into the editor only viewing mode.
Editor and preview viewing modeClick this icon to show both Editor and the Preview pane.
Preview only modeClick this icon to switch into the preview only mode.

Tool windows

The Server Log tab of the Jupyter tool window appears when you have any of the Jupyter server launched. The Server log tab of this window shows the current state of the Jupyter server and the link to the notebook in a browser.

Jupyter server tool window: the Server log tab

It also provides controls to stop the running server (Stop the server) and launch the stopped server (Run the server ).

The Variables tab provides the detailed report about variable values of the executed cell.

Jupyter server tool window: the Variables tab
Last modified: 15 June 2021