'Anaconda-Jupyter Doesn't open in browser

I installed Anaconda 3.7 on Ubuntu 18.04 (Bionic Beaver). Installation was successful. When I tried to start Jupyter Notebook from navigator it throws the following error.

Access to the file was denied The file at file:///run/user/1000/jupyter/nbserver-26395-open.html is not readable. It may have been removed, moved or file permissions may be preventing access.



Solution 1:[1]

For me, this worked on Raspberry Pi4, Ubuntu 20.04, with Chromium Browser.

Generate the config file with following command.

jupyter notebook --generate-config

Config file is created at ~/.jupyter directory

Look for parameter c.NotebookApp.use_redirect_file and set the same as False.

c.NotebookApp.use_redirect_file = False in order to disable launching browser by redirect file .

Explanation:

For versions of notebook > 5.7.2, a security feature measure was added that prevented the authentication token used to launch the browser from being visible. This feature makes it difficult for other users on a multi-user system from running code in your Jupyter session as you. However, some environments (like Windows Subsystem for Linux (WSL) and Chromebooks), launching a browser using a redirect file can lead the browser failing to load. This is because of the difference in file structures/paths between the runtime and the browser.

Also make sure the ~/.local/share/jupyter and ~/.jupyter directories are owned by the user running jupyter

Solution 2:[2]

Ckick the link your terminal

As shown in the image, jupyter notebook also provides a link. Try opening it with the browser of your choice. It worked for me...

Solution 3:[3]

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= or http://127.0.0.1:8889/?token=).

Solution 4:[4]

For anyone interested in open jupyterlab or jupyter notebook in chrome : install it in the terminal with

sudo apt-get install google-chrome-stable

It didn't work for me by using chromium. And, as mentionned paugier, 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. So if you install chrome by using the terminal it works.

Solution 5:[5]

Open Chrome and paste the Jupiter file path. In my case it's file:///home/vanx/.local/share/jupyter/runtime/nbserver-14511-open.html and it worked.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arun
Solution 2 Rahul Sood
Solution 3 paugier
Solution 4 GelatineV
Solution 5 VanX