Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know how many sessions are open and in which port using Jupyter notebook on Windows

Tags:

jupyter

I am using a windows machine and I have several running sessions of the jupyter notebook. Each session display the content in different ports. I would like to know if there is a way of getting a report including the different sessions I am running and the different ports on which they are displaying the content. I could not find that in the documentation.

like image 850
Juan Osorio Avatar asked Mar 08 '23 08:03

Juan Osorio


1 Answers

Usually what you can do is pass the --help flag to the jupyter notebook command and read the informations in particular here

$ jupyter notebook --help
The Jupyter HTML Notebook.

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

Subcommands
-----------

Subcommands are launched as `jupyter-notebook cmd [args]`. For information on
using subcommand 'cmd', do: `jupyter-notebook cmd -h`.

list
    List currently running notebook servers.
stop
    Stop currently running notebook server for a given port
password
    Set a password for the notebook server.

Options
-------
...

Oh ! A list sub command. let's try it:

$ jupyter notebook list
Currently running servers:
http://localhost:8888/ :: /Users/myuser/dev/ipython-website
http://localhost:8889/ :: /Users/myuser

.. well that's on macOS, but you should get the same on Windows.

One of the questions is why do you have multiple sessions as the notebok can browse the filesystem. It is likely confusing.

Enjoy.

like image 112
Matt Avatar answered Mar 09 '23 20:03

Matt