5

I'm currently running Ubuntu MATE 21.10.
As an experiment (to be ready to Firefox deb → Snap migration) I have removed deb-packaged Firefox from it by

sudo apt-get autopurge firefox

and installed Snap version of Firefox with

snap install firefox
$ snap list firefox 
Name     Version   Rev  Tracking       Publisher  Notes
firefox  96.0.2-1  886  latest/stable  mozilla✓   -

Its permissions are default: only "Use any connected joystick" and "Read access to network settings" are disabled.

Also I have installed Jupyter Notebook from official repositories on this system by

sudo apt-get install jupyter-notebook

When I launch Jupyter Notebook using jupyter-notebook from terminal it shows some greeting message:

$ jupyter-notebook 
[I 18:24:31.237 NotebookApp] Serving notebooks from local directory: /home/i
[I 18:24:31.237 NotebookApp] Jupyter Notebook 6.2.0 is running at:
[I 18:24:31.237 NotebookApp] http://localhost:8888/?token=7d0bbefd6ff58eddf9a1dbbd3d63e273282311d5b346cbe3
[I 18:24:31.237 NotebookApp]  or http://127.0.0.1:8888/?token=7d0bbefd6ff58eddf9a1dbbd3d63e273282311d5b346cbe3
[I 18:24:31.237 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:24:31.295 NotebookApp]

To access the notebook, open this file in a browser: file:///home/i/.local/share/jupyter/runtime/nbserver-2252-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=7d0bbefd6ff58eddf9a1dbbd3d63e273282311d5b346cbe3 or http://127.0.0.1:8888/?token=7d0bbefd6ff58eddf9a1dbbd3d63e273282311d5b346cbe3

then opens Firefox with error message inside it:

Access to the file was denied

The file at /home/i/.local/share/jupyter/runtime/nbserver-2252-open.html is not readable.

It may have been removed, moved, or file permissions may be preventing access.

From the same machine I can access this file using terminal

$ ls -al /home/i/.local/share/jupyter/runtime/nbserver-2252-open.html
-rw-rw-r-- 1 i i 673 Jan 28 18:24 /home/i/.local/share/jupyter/runtime/nbserver-2252-open.html

or using deb-packaged Epiphany.

I already know that there is a workaround by visiting localhost's URLs (http://localhost:8888/?token=7d0bbefd6ff58eddf9a1dbbd3d63e273282311d5b346cbe3 or http://127.0.0.1:8888/?token=7d0bbefd6ff58eddf9a1dbbd3d63e273282311d5b346cbe3), but it is not user-friendly and break normal expected workflow.

N0rbert
  • 103,263

2 Answers2

3

Err, you cant. I tried to look at hidden directories (.local etc) with different browsers and none work. But hang on there is a workaround: see this link. Your browser will/should open with the link http://localhost:8888/?token=blahblah automatically.

NB: creating and editing the conf file worked but the cleanup didn't work for me.

Create the configuration file by running the command:

jupyter-notebook --generate-config

Edit the file

~/.jupyter/jupyter_notebook_config.py

and set:

c.NotebookApp.use_redirect_file = False

3

Just make a launcher to circumvent the snap restraint.

A simple launcher would look like:

#!/bin/bash
export JUPYTER_DATA_DIR=/home/$USER/Public
export JUPYTER_RUNTIME_DIR=/home/$USER/Public

jupyter-notebook

...or skip the launcher and set the environment variables wherever convenient.

N0rbert
  • 103,263
WU-TANG
  • 3,316