Jupyter notebook support
Available only in PyCharm Professional: download to try or compare editions
With Jupyter Notebook integration available in PyCharm, you can edit, execute, and debug notebook source code and examine execution outputs including stream data, images, and other media.
Notebook support in PyCharm includes:
Coding assistance:
Error and syntax highlighting.
Ability to create line comments Ctrl0/.
Ability to execute IPython commands in the Python console.
Dedicated Jupyter Notebook Debugger.
Shortcuts for basic operations with Jupyter notebooks.
Ability to recognize .ipynb files and mark them with the
icon.
Jupyter project template.
Jupyter-specific AI features.
To start working with Jupyter notebooks in PyCharm:
Create a Jupyter project.
Open or create an .ipynb file.
Add and edit source cells.
Execute any of the code cells to launch the Jupyter server.
The Jupyter notebook toolbar provides quick access to all basic operations with notebooks:
![Jupyter toolbar Jupyter toolbar](https://resources.jetbrains.com/help/img/idea/2024.2/py_ds_jupyter_toolbar.png)
Item | Description |
---|---|
Code Cell Below | Adds a code cell below the selected cell. |
Cut | Moves the selected item or items from the current location to the clipboard. Moves the entire cell if it's selected. |
Copy | Copies the selected item or items to the clipboard. Copies the entire cell if it's selected. |
Paste | Inserts the contents of the clipboard into the selected location. If you've selected an entire cell, the contents are pasted to a new cell below the selected one. |
Move Cell Up | Moves the current cell up. |
Move Cell Down | Moves the current cell down. |
Run Cell and Select Below | Executes this cell and selects a cell below. If there is no cell below, PyCharm will create it. |
Debug Cell | Starts debugging for the selected cell. |
Interrupt Kernel | Click this icon if you want to interrupt any cell execution. |
Restart Kernel | Click this icon to restart the currently running kernel. |
Run All | Executes all cells in the notebook. |
Clear All Outputs | Clears all outputs in the notebook. |
Delete Cell | Deletes the current cell. |
You can select a cell type from this list and change the type for the selected 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. | |
Select Cell Above | This action selects the cell above. |
Select Cell Below | This action selects the cell blow. |
Open Notebook in Browser | You can preview the notebook in a browser. |
A cell contains a piece of either a code or Markdown text. When you run a code cell, you can view the cell output, which is the result of code execution:
![Code cell Code cell](https://resources.jetbrains.com/help/img/idea/2024.2/py_codecell.png)
The Server tab of the Jupyter tool window appears when you have any of the Jupyter servers launched. The Server 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/2024.2/py_jupyter_tool_window.png)
It also provides controls to stop the running server () and launch the stopped server (
).
The Variables tab of the Jupyter tool window provides a 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/2024.2/py_jupyter_variable_view.png)
You can use the icon to manage the variables loading policy.
For .ipynb files, both Markdown
and Python
cells can be displayed in the Structure tool window.
A Python cell is displayed only if it starts with a comment. The initial comment's content is used as the cell's title.
![Structure tool window for Jupyter Structure tool window for Jupyter](https://resources.jetbrains.com/help/img/idea/2024.2/py_jupyter_structure.png)
Thanks for your feedback!