Jupyter Installation and Running [Solved]

Everything about X, Gnome, KDE, ... and everything running on it

Jupyter Installation and Running [Solved]

Postby larry77 » 2021-03-03 13:06

Dear All,
I am trying to run some python notebooks on my box (debian 10).
This is what I have installed
Code: Select all
$ sudo apt list --installed | grep jupyter

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

jupyter-client/stable,now 5.2.3-1 all [installed,automatic]
jupyter-console/stable,now 5.2.0-1 all [installed,automatic]
jupyter-core/stable,now 4.4.0-2 all [installed,automatic]
jupyter-nbconvert/stable,now 5.4-2 all [installed,automatic]
jupyter-nbextension-jupyter-js-widgets/stable,now 6.0.0-4 all [installed,automatic]
jupyter-nbformat/stable,now 4.4.0-1 all [installed,automatic]
jupyter-notebook/stable,now 5.7.8-1 all [installed,automatic]
jupyter/stable,now 4.4.0-2 all [installed]
python3-jupyter-client/stable,now 5.2.3-1 all [installed,automatic]
python3-jupyter-console/stable,now 5.2.0-1 all [installed,automatic]
python3-jupyter-core/stable,now 4.4.0-2 all [installed,automatic]


However, if I try running

Code: Select all
$ jupyter notebook
Traceback (most recent call last):
  File "/usr/bin/jupyter-notebook", line 11, in <module>
    load_entry_point('notebook==5.7.8', 'console_scripts', 'jupyter-notebook')()
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/notebook/notebookapp.py", line 1630, in initialize
    self.init_webapp()
  File "/usr/lib/python3/dist-packages/notebook/notebookapp.py", line 1407, in init_webapp
    self.http_server.listen(port, self.ip)
  File "/usr/lib/python3/dist-packages/tornado/tcpserver.py", line 143, in listen
    sockets = bind_sockets(port, address=address)
  File "/usr/lib/python3/dist-packages/tornado/netutil.py", line 168, in bind_sockets
    sock.bind(sockaddr)
OSError: [Errno 99] Cannot assign requested address


it fails miserably. What am I doing wrong?
Any suggestion is appreciated!
Last edited by larry77 on 2021-03-04 07:57, edited 1 time in total.
User avatar
larry77
 
Posts: 544
Joined: 2006-09-24 17:59

Re: Jupyter Installation and Running

Postby mm3100 » 2021-03-03 18:05

I have installed it using pip3. I just ran
Code: Select all
pip3 install notebook


Says more on their site
https://jupyter.org/install
mm3100
 
Posts: 77
Joined: 2020-10-21 21:39

Re: Jupyter Installation and Running

Postby kedaha » 2021-03-03 18:23

hi,
Maybe some necessary packages didn't get installed? On my system it works fine:
Code: Select all
# apt install jupyter
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-4.19.0-13-amd64
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  jupyter-client jupyter-console jupyter-core jupyter-nbconvert
  jupyter-nbextension-jupyter-js-widgets jupyter-nbformat jupyter-notebook
  libjs-backbone libjs-bootstrap-tour libjs-codemirror libjs-es6-promise
  libjs-jed libjs-jquery-typeahead libjs-jquery-ui libjs-marked libjs-moment
  libjs-requirejs libjs-requirejs-text libjs-term.js libjs-text-encoding
  python3-bleach python3-decorator python3-defusedxml python3-ipykernel
  python3-ipython python3-ipython-genutils python3-ipywidgets
  python3-jsonschema python3-jupyter-client python3-jupyter-console
  python3-jupyter-core python3-mistune python3-nbconvert python3-nbformat
  python3-notebook python3-pandocfilters python3-pickleshare
  python3-prometheus-client python3-prompt-toolkit python3-send2trash
  python3-simplegeneric python3-terminado python3-testpath python3-tornado
  python3-traitlets python3-wcwidth python3-widgetsnbextension python3-zmq
Suggested packages:
  jupyter-qtconsole python-ipywidgets libjs-jquery-lazyload libjs-json
  libjs-jquery-ui-docs python-bleach-doc python-ipywidgets-doc
  python-jsonschema-doc python-nbconvert-doc python-notebook-doc
  python-tornado-doc python3-twisted
The following NEW packages will be installed:
  jupyter jupyter-client jupyter-console jupyter-core jupyter-nbconvert
  jupyter-nbextension-jupyter-js-widgets jupyter-nbformat jupyter-notebook
  libjs-backbone libjs-bootstrap-tour libjs-codemirror libjs-es6-promise
  libjs-jed libjs-jquery-typeahead libjs-jquery-ui libjs-marked libjs-moment
  libjs-requirejs libjs-requirejs-text libjs-term.js libjs-text-encoding
  python3-bleach python3-decorator python3-defusedxml python3-ipykernel
  python3-ipython python3-ipython-genutils python3-ipywidgets
  python3-jsonschema python3-jupyter-client python3-jupyter-console
  python3-jupyter-core python3-mistune python3-nbconvert python3-nbformat
  python3-notebook python3-pandocfilters python3-pickleshare
  python3-prometheus-client python3-prompt-toolkit python3-send2trash
  python3-simplegeneric python3-terminado python3-testpath python3-tornado
  python3-traitlets python3-wcwidth python3-widgetsnbextension python3-zmq
0 upgraded, 49 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,722 kB of archives.
After this operation, 36.4 MB of additional disk space will be used.
Do you want to continue? [Y/n]

After which:
Code: Select all
$ jupyter notebook
[I 20:01:15.085 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 20:01:15.752 NotebookApp] Serving notebooks from local directory: /home/user
[I 20:01:15.752 NotebookApp] The Jupyter Notebook is running at:
[I 20:01:15.752 NotebookApp] http://localhost:8888/?token=f274b02a783d6cd2d82d0af5828e0253917730eda2aed691
[I 20:01:15.752 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 20:01:15.778 NotebookApp]
   
    To access the notebook, open this file in a browser:
        file:///run/user/1000/jupyter/nbserver-8777-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=f274b02a783d6cd2d82d0af5828e0253917730eda2aed691
User avatar
kedaha
 
Posts: 3163
Joined: 2008-05-24 12:26

Re: Jupyter Installation and Running

Postby larry77 » 2021-03-03 18:39

Hi!
Are you running debian stable as well?
Because I did install jupyter via apt.
I also tried the pip installation, but the result is the same.

I wonder if the bug is related to this

https://github.com/jupyter/notebook/issues/3837

and it has been neglected in debian stable.
User avatar
larry77
 
Posts: 544
Joined: 2006-09-24 17:59

Re: Jupyter Installation and Running

Postby kedaha » 2021-03-03 19:18

Yes, I'm running stable. Only difference is that I'm using the backported 5.10 kernel, but that has nothing to do with it.
User avatar
kedaha
 
Posts: 3163
Joined: 2008-05-24 12:26

Re: Jupyter Installation and Running

Postby larry77 » 2021-03-03 19:48

kedaha wrote:Yes, I'm running stable. Only difference is that I'm using the backported 5.10 kernel, but that has nothing to do with it.


Then it is really strange. I saw that I have installed the same packages as you did (if I try to install the ones that you listed, my system tells me they are already installed. I installed some of them before installing jupyter).
I wonder if it could be related to the browser. Which one is your default?
User avatar
larry77
 
Posts: 544
Joined: 2006-09-24 17:59

Re: Jupyter Installation and Running

Postby larry77 » 2021-03-03 20:12

After a massive

Code: Select all
sudo apt purge *jupyter*


followed by a reinstallation, it seems to be working fine.
I will keep this under observation for a day or two and if (finger crossed!) there are no surprises, I will mark this as solved.
User avatar
larry77
 
Posts: 544
Joined: 2006-09-24 17:59

Re: Jupyter Installation and Running

Postby kedaha » 2021-03-03 20:14

My default browser is Chromium.
User avatar
kedaha
 
Posts: 3163
Joined: 2008-05-24 12:26

Re: Jupyter Installation and Running

Postby mm3100 » 2021-03-03 23:21

I have used firefox with Debian stable as well. No issues, possible that something went wrong during installation.
mm3100
 
Posts: 77
Joined: 2020-10-21 21:39

Re: Jupyter Installation and Running

Postby larry77 » 2021-03-04 07:57

I solved the mystery!
Believe it or not, the settings of my VPN interfered with Jupyter calling the browser.
If I switch off my VPN, then everything works.
Weird....
User avatar
larry77
 
Posts: 544
Joined: 2006-09-24 17:59

Re: Jupyter Installation and Running [Solved]

Postby mm3100 » 2021-03-04 19:35

Found reason here
https://stackoverflow.com/questions/32103885/not-able-to-access-local-server-running-after-vpn-connection

Since jupyter notebook has url http://localhost:8888/tree in browser.

Nice to found out something new.
mm3100
 
Posts: 77
Joined: 2020-10-21 21:39

Re: Jupyter Installation and Running [Solved]

Postby Head_on_a_Stick » 2021-03-05 17:29

Don't use pip: https://xkcd.com/1987/
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Jupyter Installation and Running [Solved]

Postby mm3100 » 2021-03-06 03:46

Head_on_a_Stick wrote:Don't use pip: https://xkcd.com/1987/


I am a silly creature that got used to using pip3. While there is nothing bad about that itself, recommending it might be a sin.

Next time I will try to find out how to install needed packages using apt instead.
mm3100
 
Posts: 77
Joined: 2020-10-21 21:39


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable