LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-20-2020, 08:14 AM   #1
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Rep: Reputation: Disabled
Jupyter notebook


Hello everyone,

I have a little trouble with Jupyter Notebook, which is not opening in my browser.
I have spent the last two hours on tutorials to solve the problem, and just don't understand what the cause of it.

I am working on Ubuntu 19.04 disco dingo.

I have installed jupyter core 4.6.1, and jupyter-notebook : 5.7.8.
Code:
user@host:~$ jupyter notebook
[I 14:08:44.748 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:08:44.753 NotebookApp] Serving notebooks from local directory: /home/usr
[I 14:08:44.754 NotebookApp] The Jupyter Notebook is running at:
[I 14:08:44.754 NotebookApp] http://localhost:8889/?token=e689e92b21a8e1a1af49753fd70df83150ea132e31e27fa2
[I 14:08:44.754 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:08:44.756 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/usr/.local/share/jupyter/runtime/nbserver-6350-open.html
    Or copy and paste one of these URLs:
        http://localhost:8889/?token=e689e92b21a8e1a1af49753fd70df83150ea132e31e27fa2

Would anyone know why the Jupyter notebook is not opening directly in a browser?

Thanks for your help.
 
Old 01-20-2020, 08:46 AM   #2
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 4,005
Blog Entries: 33

Rep: Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471
Drosera_capensis,

Code:
sudo apt install python3-notebook jupyter jupyter-core python-ipykernel
To start jupyter:

Code:
jupyter notebook
 
Old 01-20-2020, 09:59 AM   #3
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
Thanks beachboy2, I have run the first command successfully.

However, the second gives the same result:

Code:
usr@host:~$ jupyter notebook
[I 15:54:13.944 NotebookApp] Serving notebooks from local directory: /home/usr
[I 15:54:13.944 NotebookApp] The Jupyter Notebook is running at:
[I 15:54:13.944 NotebookApp] http://localhost:8888/?token=93cb395e62594c623c17f8e397d2e0d1b3b17432cba6a215
[I 15:54:13.944 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 15:54:13.947 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/usr/.local/share/jupyter/runtime/nbserver-10170-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=93cb395e62594c623c17f8e397d2e0d1b3b17432cba6a215
And the browser page (firefox) gives the following message:

Quote:
Access to the file was denied

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

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

Last edited by Drosera_capensis; 01-20-2020 at 10:01 AM.
 
Old 01-20-2020, 03:30 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
May be obvious, but...
Does the file exist and what are its permissions/ownership?
 
Old 01-21-2020, 10:48 AM   #5
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
Thanks for remembering me this ondoho!

To be on the safe side, I have given full permission on the file.

When opened directly with:

Code:
jupyter notebook file

[I 16:39:36.637 NotebookApp] The Jupyter Notebook is running at:
[I 16:39:36.637 NotebookApp] http://localhost:8888/?token=e08837a263b840e9744f0d0db3d3cdbc3d957c48e07990d0
[I 16:39:36.637 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:39:36.641 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/usr/.local/share/jupyter/runtime/nbserver-19293-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=e08837a263b840e9744f0d0db3d3cdbc3d957c48e07990d0
The webpage gives:
Code:
Firefox can't find the file at /tmp/tmpKNd42Y.html.
The first link gives access to this page:
Code:
The file at /home/usr/.local/share/jupyter/runtime/nbserver-19293-open.html is not readable.
The second link gives access to the Jupyter browser. When trying to open the document, it gives:
Code:
500 : Internal Server Error
I know the file is not corrupted, as it was working previously.

Would anyone have an idea of what is happening?

Last edited by Drosera_capensis; 01-21-2020 at 11:22 AM.
 
Old 01-21-2020, 10:54 AM   #6
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
PS:

I am working with full anaconda.

I have tried a snap installation and a conda installation. In both cases, Jupyter notebook fail.

Would anyone know a version that might work with a fresh installation?
 
Old 01-21-2020, 11:28 AM   #7
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
PPS:

I have noticed that when using the jupyter notebook command after a fresh anaconda installation, I got this message:

Quote:
The file at /home/usr/.local/share/jupyter/runtime/nbserver-28511-open.html is not readable.
I have checked, and indeed this file is not existing.

Would anyone know what is this file?
 
Old 01-22-2020, 03:04 AM   #8
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 4,005
Blog Entries: 33

Rep: Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471
Drosera_capensis,

https://github.com/jupyter/notebook/issues/4500
 
Old 01-22-2020, 05:00 AM   #9
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
Thanks for the answer beachboy2.

This command line has solved my browser problem. Therefore, it is opening the Jupyter browser interface when executing the command:
Code:
Jupyter notebook
However, trying to open the file.ipynb, it still gives
Code:
500 : Internal Server Error
on the web page.

I have tried to upgrade nconvert or to re-install it to solve the problem, as mentioned in different forums, but it doesn't work.
Does anyone has another solution for this?
 
Old 01-24-2020, 06:10 PM   #10
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Rep: Reputation: Disabled
I vaguely remember something related to the way jupyter wrongly binds to IPs.

Try adding --ip=0.0.0.0 or --host=0.0.0.0 to your jupyter launching command.

Sorry for being obscure, all I remember I found this in a github issue by googling and added it to my personal knowledge base, but didn't record the source link.
 
Old 02-07-2020, 05:08 AM   #11
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
Thank you very much FlinchX. I have tried the commands, but unfortunately, it does not work.

I really wonder what could be the cause of the problem. Jupyter and anaconda has been re-installed twice and it is still failing.

I don't really understand how the server can be an issue as I am on a local machine. If anyone has the beginning of an explanation, I am interested!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to set up PySpark for your Jupyter notebook LXer Syndicated Linux News 0 11-12-2018 04:33 PM
LXer: Getting started with Jupyter Notebooks LXer Syndicated Linux News 0 03-28-2018 07:33 PM
Anaconda on Suse linux, how to start jupyter-notebook? rusty377 Linux - Newbie 4 09-29-2017 05:33 PM
LXer: How to Install Jupyter on an Ubuntu 16.04 VPS LXer Syndicated Linux News 0 02-03-2017 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration