Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List running instances of jupyter lab

Jupyter notebook comes with the useful command:

jupyter notebook list

which outputs all the running server instances for the current user. Besides it lists the relevant access tokens.

Jupyter lab seems not to have this feature.

Cruising through the jupyter lab manual I could not find the analogous command (not the analogous syntax seems to work).

Any suggestion on how to get ports and tokens for the running servers?

like image 567
Acorbe Avatar asked May 30 '18 14:05

Acorbe


3 Answers

It seems like you can still call jupyter notebook list within any terminal to list all the running notebook instances, including those within jupyter lab.

like image 59
TYZ Avatar answered Jan 02 '23 16:01

TYZ


If you are using JupyterLab 3.0+, the command you're looking for is:

jupyter server list
like image 22
abdallahrrrr Avatar answered Jan 02 '23 16:01

abdallahrrrr


One can now use the list command with Jupyter lab to show running servers:

jupyter lab list

If you want to list the associated sessions for that server there doesn't appear to be built-in command but (as mentioned here) you can run this to a get prettified (with jq) JSON list using the Jupyter REST API - assuming your server runs at localhost:8888 and :

curl -sSLG localhost:8888/api/sessions --data-urlencode `jupyter lab list | awk '/token/ {split($1,a,"?")} END {print a[2]}'`  | jq
like image 28
Pierz Avatar answered Jan 02 '23 16:01

Pierz