'Jupyter Lab not opening on Ubuntu

Im using Ubuntu as my OS. I have been able to download and open anaconda-navigator through command line. but I can't open up Jupyter lab or jupyter notebook. it is giving me the following error.

Access to the file was denied
The file at file:///home/basant/.local/share/jupyter/runtime/jpserver-6359-open.html is not readable. It may have been removed, moved or file permissions may be preventing access.

I tried changing permissions but it hasn't helped. uninstalled and re-installed everything. didn't work.



Solution 1:[1]

I had the same problem after an Ubuntu upgrade. The problem was solved by two steps:

  1. Generate a jupyter config file, from terminal type:

     jupyter notebook --generate-config 
    
  2. Then open the file, which is saved at /home/username/.jupyter/jupyter_notebook_config.py, append c.NotebookApp.use_redirect_file = False and save. You can now start jupyter.

Solution 2:[2]

I don't have sufficient reputation to add a comment, which would have been my preference, but found the answer above also resolved a similar issue on Ubuntu 22.04 using jupyter-lab. I am using Jupyter without Anaconda:

input: jupyter-lab

output: Access to the file was denied

The file at .local/share/jupyter/runtime/jpserver-42340-open.html is not readable. It may have been removed, moved, or file permissions may be preventing access.

The file did not exist so changing permissions made no sense.

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 Suraj Rao
Solution 2 Sildeag