Jupyter notebook support
Last modified: 10 August 2022With 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.
note
You can try DataSpell, a new IDE that is tailored to the data science workflow. It provides a brand-new experience for working with Jupyter notebooks. The IDE is available as part of the Early Access program to collect early feedback and gain insight into the needs and behavior of data scientists. See the DataSpell Getting Started Guide for more details.
Notebook support in IntelliJ IDEA includes:
Coding assistance:
Error and syntax highlighting.
Ability to create line comments Ctrl+/.
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
icon.
Quick start with the Jupyter notebook in IntelliJ IDEA
To start working with Jupyter notebooks in IntelliJ IDEA:
Create a new project, specify a virtual environment, and install the jupyter package.
Open or create an .ipynb file.
Add and edit source cells.
Execute any of the code cells to launch the Jupyter server.
Get familiar with the user interface
Mind the following user interface features when working with Jupyter notebooks in IntelliJ IDEA.
Notebook editor
![Overview of the editor UI Overview of the editor UI](https://resources.jetbrains.com/help/img/idea/2022.1/py_ds_editor_overview.png)
A Jupyter notebook opened in the editor has its specific UI elements:
Jupyter notebook toolbar: provides quick access to the most popular actions. The rest of the notebook specific actions are available in the Cell menu.
Code cell: a notebook cell that contains an executable code
Cell output: results of the code cell execution; can be presented by a text output, table, or plot.
Cell toolbar: a toolbar of the code cell with the most popular commands. By default, cell toolbars are disabled. To enable them, open project settings/preferences (Ctrl+Alt+S), go to Languages & Frameworks | Jupyter, and select the Show cell toolbar checkbox.
Cell toolbar
Each code cell has its configurable toolbar so that you can easily access the most popular commands and actions. By default, cell toolbars are disabled. To enable them, open project settings/preferences (Ctrl+Alt+S), go to Languages & Frameworks | Jupyter, and select the Show cell toolbar checkbox.
Toolbar element | Description |
---|---|
Executes the code cell. | |
Executes this cell and select the cell below. Press Shift+Enter to call the same action. | |
Moves the current cell up | |
Moves the current cell down | |
Deletes the current cell | |
Open the list of additional call actions:
|
Notebook toolbar
The Jupyter notebook toolbar provides quick access to all basic operations with notebooks:
![Jupyter toolbar Jupyter toolbar](https://resources.jetbrains.com/help/img/idea/2022.1/py_ds_jupyter_toolbar.png)
Toolbar element | Description |
---|---|
Add a code cell below the selected cell. | |
Moves the current cell up | |
Moves the current cell down | |
Executes this cell and selects a cell below. If there is no a cell below, IntelliJ IDEA will create it. | |
Starts debugging for this cell. | |
Click this icon if you want to interrupt any cell execution. | |
Click this icon to restart the currently running kernel | |
Executes all cells in the notebook. | |
You can select a cell type from this list and change the type for the selected cell. | |
Deletes the current cell. | |
The 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 the available Jupyter kernels. | |
Select this checkbox to allow executing JavaScript in your Jupyter notebook. | |
This actions selects the cell above. | |
This actions selects the cell blow. | |
You can preview the notebook in a browser. |
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 Jupyter server tool window: the Server log tab](https://resources.jetbrains.com/help/img/idea/2022.1/py_ds_jupyter_tool_window.png)
It also provides controls to stop the running server () and launch the stopped server (
).
The Jupyter Variables tool window the detailed report about variable values of the executed cell.
![Jupyter server tool window: the Variables tab Jupyter server tool window: the Variables tab](https://resources.jetbrains.com/help/img/idea/2022.1/py_jupyter_variable_view.png)
Thanks for your feedback!