Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between `jupyter notebook` and `jupyter server`?

Running jupyter notebook and jupyter server give me very similar results and the descriptions are also quite similar.

❯ jupyter notebook -h
The Jupyter HTML Notebook.

This launches a Tornado based HTML Notebook Server that serves up an
HTML5/Javascript Notebook client.

❯ jupyter server -h
The Jupyter Server.

This launches a Tornado-based Jupyter Server.

There are differences like server doesn't load nbextensions but I don't understand why there are two commands that have so much overlap.

For reference, this are the versions of various modules.

❯ jupyter --version
jupyter core     : 4.7.1
jupyter-notebook : 6.3.0
qtconsole        : 5.0.3
ipython          : 7.22.0
ipykernel        : 5.3.4
jupyter client   : 6.1.12
jupyter lab      : 3.0.11
nbconvert        : 6.0.7
ipywidgets       : 7.6.3
nbformat         : 5.1.3
traitlets        : 5.0.5
like image 205
saiwing Avatar asked Jun 01 '21 23:06

saiwing


People also ask

What are Jupyter servers for?

The Jupyter Server provides the backend (i.e. the core services, APIs, and REST endpoints) for Jupyter web applications like Jupyter notebook, JupyterLab, and Voila.

What is the difference between Jupyter and Jupyter Notebook?

JupyterLab uses the exact same Notebook server and file format as the classic Jupyter Notebook, so that it is fully compatible with the existing notebooks and kernels. The Classic Notebook and Jupyterlab can run side to side on the same computer. One can easily switch between the two interfaces.

Why is Jupyter Notebook a server?

The Jupyter Notebook App is a server-client application that allows editing and running notebook documents via a web browser. The Jupyter Notebook App can be executed on a local desktop requiring no internet access (as described in this document) or can be installed on a remote server and accessed through the internet.

What is a notebook server?

ArcGIS Notebook Server is a complete data science platform integrated with the ArcGIS Enterprise portal. Introduced at 10.7, ArcGIS Notebook Server is a server role in ArcGIS Enterprise that hosts and runs ArcGIS Notebooks.


1 Answers

Jupyter Notebook (notebook module) contains both:

  • the server for notebooks (the backend of the web application that hosts the notebook contents, proxies interaction with kernels, and interacts with the operating system by e.g. opening an internet browser on start; this part is generally written in Python), and
  • the client (the frontend of the web application, e.g. HTML code, javascript, and some extra REST API points on the server).

However, because there are now multiple clients (frontends) providing different web applications for notebooks:

  • Jupyter Notebook
  • JupyterLab
  • RetroLab
  • nteract
  • multiple proprietary clients developed outside of project Jupyter

It made sense to split the server component used by all of these so that e.g. JupyterLab does not have to depend on notebook. This also means that if a fix to the server component is needed, it can be released quickly independent of Jupyter Notebook release cycle (and users of all frontents can benefit immediately).

As a consequence, and to make the break up clean, the old Jupyter Notebook was split into:

  • jupyter-server - the server which was adapted by JuptyterLab, RetroLab, nteract
  • nbclassic - the Jupyter Notebook as a jupyter-server extension

This implies changes for users and developers, some already described in "migrate from notebook" docs:

  • the options specific to server rather than notebook were renamed from c.NotebookApp to c.ServerApp (the options specific to notebook remain c.NotebookApp)
  • the server-specific configuration is now stored in jupyter_server_config.py rather than jupyter_notebook_config.py (same for .json version)
  • users should now use jupyter server extension rather than jupyter serverextension (note the extra space!) to list, enable or disable extensions
  • the server extensions need to place their files in a new location: etc/jupyter/jupyter_server_config.d rather than etc/jupyter/jupyter_notebook_config.d (in practice most extensions that were updated to support jupyter server are now placing files in both locations for backward compatibility with notebook, but this will change in the future)

It is important to note that depending on how you start your jupyter notebook, you will see different servers being used:

  • jupyter nbclassic (assuming nbclassic is installed) will use the new jupyter-server
  • jupyter notebook will use the old notebook server
  • jupyter lab will use new jupyter-server starting with JupyterLab 3.0 unless running on JupyterHub/Binder where it might still be using old notebook server, depending on configuration

This also implies that you may see different extensions when running jupyter notebook vs jupyter nbclassic (depending on whether their developers updated the locations, and whether they decided they want to support the legacy notebook server).

The creation of nbclassic replacement rather than removal of the server code from existing notebook package was meant to ensure backward compatibility, and this is why you still have two copies of the Tornado server (one provided by jupyter notebook and one by jupyter server). To make the situation simpler you could remove notebook and install nblcassic, but given that the transition is in progress you may need to adjust a few things manually. However, this is only a temporary situation, as it is planned that Notebook will be migrated to use jupyter server starting with v7.0.

This might look inconvenient for now, but this step ensures greater maintainability of the core Jupyter infrastructure in the future and will benefit users and system admins greatly later on.

like image 152
krassowski Avatar answered Jan 04 '23 15:01

krassowski