How to make my JupyterLab notebook execution synchronized in 2 web-browser tabs?
Jan 25, 11:31pm

To synchronize the execution of a JupyterLab notebook across two web browser tabs, you need to ensure that both tabs are connected to the same Jupyter server and that the notebook state is shared. Here’s how you can achieve this:


1. Use the Same Jupyter Server

  • Open both browser tabs from the same JupyterLab server URL.
  • Ensure you are logged in with the same user account in both tabs.

2. Open the Same Notebook

  • In both tabs, open the same notebook file (.ipynb).
  • JupyterLab does not natively support real-time synchronization, but the notebook state (cell outputs, variables, etc.) is tied to the kernel. If both tabs use the same kernel, they will share the same state.

3. Use the Same Kernel

  • By default, JupyterLab assigns a kernel to each notebook. To synchronize execution:
    • In the first tab, note the kernel name (e.g., Python 3 (ipykernel)).
    • In the second tab, go to Kernel > Change Kernel and select the same kernel as the first tab.
    • If the kernel is not already running, starting it in one tab will make it available in the other.

4. Manual Synchronization

  • If you execute a cell in one tab, the other tab will not automatically update. To see the changes:
    • Refresh the notebook in the second tab.
    • Or, re-run the relevant cells in the second tab.

5. Advanced: Use JupyterLab Extensions (Optional)

  • Extensions like jupyterlab-collaboration (experimental) aim to provide real-time collaborative editing, but they are not yet fully stable or widely adopted.
  • For a more robust solution, consider using Jupyter Notebook + nbviewer or Google Colab for collaborative work.

Limitations

  • JupyterLab does not natively support real-time synchronization between tabs.
  • Only the kernel state (variables, outputs) is shared, not the visual state (e.g., cell selection, scroll position).

Tip: If you need true real-time collaboration, consider using Google Colab or Deepnote, which are designed for this purpose.

Would you like help setting up a specific extension or troubleshooting kernel issues?

Jan 25, 11:31pm

This Chat is read-only. Login to resume chatting.