Spyder Notebook#

Spyder-notebook is a plugin that allows you to open, edit and interact with Jupyter Notebooks right inside Spyder.

Spyder Notebook in Spyder

Using notebooks inside Spyder allows you to take advantage of their web interface alongside Spyder’s powerful features such as the Variable explorer, console and debugger.

Installing the Notebook#

If you installed Spyder using conda, the best way to install Spyder-notebook is to run the following command in your terminal or Anaconda prompt on Windows:

conda install spyder-notebook -c conda-forge

Important

At the moment it is not possible to use this plugin with the Spyder Standalone installers for Windows and macOS. We’re working to make that possible in the future.

Restart Spyder in order to be able to use the plugin.

Using the Notebook#

When the Notebook is installed, it will be available under the menu item View ‣ Panes ‣ Notebook.

Spyder showing view panes Notebook

You will see it then as a tab in the bottom of the editor area. When switching to it, a welcome screen will be displayed, from where you can create a new notebook by right-clicking it and selecting New notebook.

Spyder with context menu showing new notebook option

You can also click the Plus button at the top right of the pane. A new Jupyter Notebook will be opened as a tab, ready for user input in a temporary file. This can serve as a scratch pad where you can do quick calculations and plots.

Spyder showing a new notebook

To save this notebook go to the options menu at the top right of the pane and click the Save as… option. This will store your notebook locally with the ipynb extension, which will allow you to open it then as a Jupyter Notebook outside of Spyder.

Gif showing save as

You can also open any Jupyter Notebook inside Spyder. For this go to the options menu at the top right of the pane and click Open, which will allow you to look for ipynb files in your computer. Click any notebook that you want to open inside Spyder and you will be able to see it as a new tab in the Notebook pane.

Gif showing opening a Jupyter notebook inside Spyder

The Open recent option displays a list of the recent notebooks you opened in Spyder, from which you can select them and open them again in Spyder.

Connecting an IPython Console#

You can connect an IPython Console to your notebook, which will allow you to view your variables in the Variable Explorer. To do so, go to the options menu and click the Open console option. This will open a new console with the same name of your notebook and display the variables of the cells that you have executed previously in your Notebook. If you don’t see them, press Enter in the console.

Gif showing connecting console and displaying variables

You can view, modify and create new ones in the console too.

Since the Variable Explorer is associated to each console, closing the notebook’s console will immediately hide the variables from the Variable Explorer.

Additional Options#

The context menu, available by right-clicking the pane area outside the notebook, allows you to zoom your notebook in or out.

Gif zooming in and out the notebook.

You can also select the code from your Notebook and copy it on your clipboard to paste this code anywhere you want.

Gif copying and pasting

Finally, you can see all the server information of your notebook by clicking the Server info option in the context menu.

Server info for notebook in Spyder