jupyter notebook access issue in Chromium
I had the same issue. I don't know what the problem is with Chrome, but a quick "fix" for me was to run:
jupyter notebook --browser firefox
so I don't have to copy-paste the link in Firefox.
The issue is chromium being a snap app in Ubuntu, if the URL is used instead of the html file, the issue is resolved.
jupyter notebook --generate-config
will output the directory for config file, edit it and add this line
c.NotebookApp.use_redirect_file = False
Your issue is probably be related to Chromium being a snap app. According to this Stack Overflow answer:
With recent versions of snap, applications installed with snap can't by default open files in hidden folders (with a name starting by
.
).In Ubuntu 20.04, chromium is installed with snap (even when using the command
sudo apt install chromium-browser
), so chromium can't open the html file used by Jupyter.As stated by @rahul-sood, a simple workaround is to copy-paste one of the alternative links given by Jupyter in the terminal (starting by
http://localhost:8889/?token=
orhttp://127.0.0.1:8889/?token=
).
This snap issue is also mentioned in this Ask Ubuntu answer:
The Snap 'home' interface permits access only to non-hidden files and directories in a user's /home.
The Snap 'personal-files' interface permits access to all files and directories in a user's /home.
- Snap interfaces are defined in the yaml file used in snap creation.
- The
personal-files
interface requires an additional$snap connect foo:foo-connect
. Thehome
interface does not, which makes it more convenient for some uses.
Also see this relevant thread in the snapcraft forum: Can browsers open local files?
Summarizing, this is probably an issue due to Chromium being a snap application. Your options are:
-
Copy and paste one of the links starting with
http://localhost:8889/?token=
orhttp://127.0.0.1:8889/?token=
in Chromium to open your notebook in it. -
Use another non-snap browser as default.
-
Use the command mentioned by Salvatore Lampitelli to open the notebook in the specified non-snap browser.
Generate a jupyter config file in terminal using commands:
jupyter notebook --generate-config
open the script jupyter_notebook_config.py in the directory
/.jupyter and uncomment the line 531 :
Set c.NotebookApp.use_redirect_file = True
toc.NotebookApp.use_redirect_file = False
.
It will work.