JetBrains DataSpell 2021.1 Help

Manage Jupyter notebook servers

In JetBrains DataSpell, you can execute code cells using:

  • Managed server – a Jupyter server that is automatically launched by JetBrains DataSpell for the current project. It will be terminated when you close JetBrains DataSpell.

  • Configured server – any Jupyter server that you connect to by specifying its URL and token.

Launch a Jupyter server

  • To run a Jupyter server just execute any code cell. When you initiate cell execution, JetBrains DataSpell launches the Jupyter server on the local host using any available port (by default, it is the 8888 port). You can switch to the Jupyter Server tool window to preview server's configuration details.

Jupyter server is running. Jupyter tool window

Once the server is launched, it is shown as a managed server in the list of the servers in the Jupyter toolbar. You can also see the automatically created server kernel in the list of kernels. This kernel is based on the.

Jupyter notebook toolbar; Managed server is connected

Stop the Jupyter server

  • To stop any running server, switch to the Jupyter Server tool window and click the the Stop button icon or select the corresponding command in the Environment menu of the main JetBrains DataSpell menu. Preview the status in the Server Log window.

Stopping the server

Once you have shut down the server, the current session is terminated. When you start the server next time using the Run server icon icon or the Environment menu of the main JetBrains DataSpell menu, execution results for all previous sessions and all notebooks will be lost.

Restart the kernel

  • You might want to refresh your calculations without shutting down the entire server and affecting any other notebooks. To restart the currently running kernel, click Kernels on the Jupyter notebook toolbar and preview the status in the Server Log window.

    Restarting the current kernel

    You can find other kernel specific commands in the Kernel menu of the JetBrains DataSpell main menu.

You can execute your notebook code cells on a specific Jupyter servers.

Configure the Jupyter server

When you launch any managed server, by default it uses the current and the automatically selected port. However, you can select any other available in your JetBrains DataSpell instance and specify an alternative port. You can also connect to any configured server if you know its URL and token.

  1. To open the server settings, select Configure Jupyter Server in the list of the Jupyter servers.

    Configure a Jupyter server

  2. Configure the server options:

    • To customize the default Jupyter server, in the Jupyter Server dialog, select Managed Server and from the Python interpreter list select any local Python.

      Select an interpreter for the managed server

    • To change the automatically detected port, type its number in the Port field.

      Specifying the port number for the managed server

    • To connect to any running Jupyter server, in the Jupyter Server dialog, select Configured Server and specify server's path including an URL and a token.

      Configure a Jupyter server. Settings dialog

  3. Once done with configuring, click Apply and OK.

  4. Execute any code cell to run the managed server or to connect to the running configured server.

  5. If you see the following warning, the kernel of the newly configured server doesn't match your current Python interpreter. For example, it might have a different set of the installed packages.

    Warning requesting to register interpreter as a kernel

    You can register your Python interpreter as a kernel on the configured server by clicking the corresponding link. After that you can see it in the list of the kernels for the configured server.

    Two kernels are registered for the configured server

Connect to a remote Jupyter server

  1. Connecting to a remote Jupyter server is an experimental feature of JetBrains DataSpell. To enable it, click Experimental features in the upper-right corner of JetBrains DataSpell or press Ctrl+Alt+S and select Experimental Features panel. Then select the corresponding checkbox, save the change, and restart the IDE.

  2. Click the Add connection on the toolbar of the Workspace tool window to establish a connection to a Jupyter server.

    Adding a new connection
  3. Specify the server URL. The target URL should contain a server name or its address, and the access token.

    Add a remote connection to a Jupyter server
  4. Once the connection has established the server and its structure are shown in the Workspace tool window under the Jupyter Connections node. Expand it to preview the remote content, open, and execute notebooks.

    Content of the remote Jupyter server
Last modified: 29 March 2021