The Jupyter Notebook is a web-based interactive computing platform. The notebook combines live code, equations, narrative text, visualizations, interactive dashboards and other media. PyCharm’s Early Access Program (EAP) continues with its fifth version. Get it now from our website. New in This Version All-new Jupyter Notebooks. You may have read in our Python Developer Survey that over half of Python developers now use Python for data science. To better meet the needs of professional data scientists, we’ve been working.
With Jupyter Notebook integration available in PyCharm, you can easily edit, execute, and debug notebook source code and examine execution outputs including stream data, images, and other media.
Notebook support in PyCharm 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:
Error and syntax highlighting.
Code completion.
Ability to create line commentsCtrl+/.
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 PyCharm
To start working with Jupyter notebooks in PyCharm:
Create a new Python project, specify a virtual environment, and install the jupyter package.
Open files in your.
If needed, configure or create a new virtual environment.
Open or create an .ipynb file.
Add and edit source cells.
Execute any of the code cells to launch the Jupyter server.
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 PyCharm.
Notebook editor
In PyCharm, you can work with Jupyter notebook files using three viewing modes:
In this mode, you can add notebook cells and edit them.
In this mode, you can both edit cells and preview their output. This is the default viewing mode for Jupyter notebooks in PyCharm.
In this mode, you can preview markdown and raw cells as well as code cell execution results.
Editing and preview modes reflect the currently selected PyCharm user interface appearance.
Notebook toolbar
The Jupyter notebook toolbar provides quick access to all basic operations with notebooks:
Opens the Jupyter Quick List for easy access to the basic notebook operations:
|
---|
Executes all cells in the notebook. |
Click this icon if you want to interrupt any cell execution. |
Click this icon to restart the currently running kernel |
Upload 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. |
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 moves the current cell up. |
This actions moves the current cell down. |
You can preview the notebook in a browser. |
Enables auto scrolling from the source cell in the Editor to the corresponding output in the Preview pane. |
Enables auto scrolling from the cell output in the Preview pane to the corresponding source cell in the Editor. |
Click this icon to show source code fragments in the Preview pane. |
Click this icon to switch into the editor only viewing mode. |
Click this icon to show both Editor and the Preview pane. |
Click 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.
It also provides controls to stop the running server () and launch the stopped server ( ).
The Variables tab provides the detailed report about variable values of the executed cell.
You can use the icon to manage the variables loading policy.
PyCharm support working with Jupyter Notebooks local and remote connection. You can create new Jupyter Notebook by right click of the mouse and selecting:
- New
- Jupyter Notebook
Then you can add new cells and enter code or Markdown. Once the cell is created and fill with code you can executed:
- on remote server
- on local server
- on server started from PyCharm
Server started from PyCharm
Starting PyCharm Jupyter Notebook server:
- Open the Notebook file
- Run a cell
- Modify the URL: http://localhost:8888 ( or the port which you like)
- Press OK
- Warning: Cannot connect to Jupyter Notebook. Run Jupyter Notebook
- New message will be shown at the top:
- PyCharm prompt: Cannot connect to Jypyter Notebook. Run Jupyter Notebook
- Press Run Jupyter Notebook
- New Jupyter server is started from PyCharm
- If you get error:
- Error executing Jupyter command '127.0.0.1': [Errno 2] No such file or directory you can apply the offered fix to install Jupyter.
If you want to check details:
- View
- Tool Windows
- Run
- You can:
- get a token
- URL address to open in browser
Connect to local server from PyCharm
Jupyter Notebook Support Pycharm Community
Starting PyCharm Jupyter Notebook server:
- Open terminal
- run command:
bash jupyter notebook list
How To Install Jupyter Notebook In Pycharm Community Edition
- Copy the address, example:
- Open the Notebook file
- Run a cell
- Paste the URL address: http://localhost:8888/?token=f8514..
- Press OK
Pycharm Jupyter Notebook Plugin
Note: If you don't have access to terminal or you don't want to use it. Then you can get the address and the token by: