Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open Jupyter notebook, multiple errors. #646

Open
DrBanana419 opened this issue Jul 15, 2021 · 11 comments
Open

Cannot open Jupyter notebook, multiple errors. #646

DrBanana419 opened this issue Jul 15, 2021 · 11 comments

Comments

@DrBanana419
Copy link

DrBanana419 commented Jul 15, 2021

When I try to run sage -n jupyter I get this (excluding the banner):

`Please wait while the Sage Jupyter Notebook server starts...
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/traitlets/traitlets.py", line 535, in get
value = obj._trait_values[self.name]
KeyError: 'allow_remote_access'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/notebook/notebookapp.py", line 1129, in _default_allow_remote
addr = ipaddress.ip_address(self.ip)
File "/usr/lib/python3.9/ipaddress.py", line 53, in ip_address
raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
ValueError: 'localhost' does not appear to be an IPv4 or IPv6 address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python-exec/python3.9/sage-notebook", line 218, in
launcher(unknown)
File "/usr/lib/python-exec/python3.9/sage-notebook", line 39, in init
main(argv)
File "/usr/lib/python3.9/site-packages/jupyter_core/application.py", line 254, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/lib/python3.9/site-packages/traitlets/config/application.py", line 844, in launch_instance
app.initialize(argv)
File "/usr/lib/python3.9/site-packages/traitlets/config/application.py", line 87, in inner
return method(app, *args, **kwargs)
File "/usr/lib/python3.9/site-packages/notebook/notebookapp.py", line 2130, in initialize
self.init_webapp()
File "/usr/lib/python3.9/site-packages/notebook/notebookapp.py", line 1759, in init_webapp
self.web_app = NotebookWebApplication(
File "/usr/lib/python3.9/site-packages/notebook/notebookapp.py", line 179, in init
settings = self.init_settings(
File "/usr/lib/python3.9/site-packages/notebook/notebookapp.py", line 282, in init_settings
allow_remote_access=jupyter_app.allow_remote_access,
File "/usr/lib/python3.9/site-packages/traitlets/traitlets.py", line 575, in get
return self.get(obj, cls)
File "/usr/lib/python3.9/site-packages/traitlets/traitlets.py", line 538, in get
default = obj.trait_defaults(self.name)
File "/usr/lib/python3.9/site-packages/traitlets/traitlets.py", line 1578, in trait_defaults
return self._get_trait_default_generator(names[0])(self)
File "/usr/lib/python3.9/site-packages/traitlets/traitlets.py", line 975, in call
return self.func(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/notebook/notebookapp.py", line 1138, in _default_allow_remote
parsed = ipaddress.ip_address(addr.split('%')[0])
AttributeError: 'int' object has no attribute 'split'`

Although I'm not sure if this is a sage issue or a jupyter issue. Here are my installed Jupyter packages (got from emerge -s jupyter):

`* dev-python/jupyter
Latest version available: 1.0.0-r3
Latest version installed: [ Not Installed ]
Size of files: 15 KiB
Homepage: https://jupyter.org
Description: Jupyter metapackage. Install all the Jupyter components in one go
License: BSD

  • dev-python/jupyter-threejs-sage [ Masked ]
    Latest version available: 122
    Latest version installed: [ Not Installed ]
    Size of files: 164 KiB
    Homepage: https://github.com/sagemath/threejs-sage
    Description: Custom build of Three.js for SageMath
    License: MIT

  • dev-python/jupyter_client
    Latest version available: 6.1.12
    Latest version installed: 6.1.12
    Size of files: 295 KiB
    Homepage: https://jupyter.org
    Description: Jupyter protocol implementation and client libraries
    License: BSD

  • dev-python/jupyter_console
    Latest version available: 6.4.0
    Latest version installed: [ Not Installed ]
    Size of files: 35 KiB
    Homepage: https://jupyter.org
    Description: A terminal-based console frontend for Jupyter kernels
    License: BSD

  • dev-python/jupyter_core
    Latest version available: 4.7.1
    Latest version installed: 4.7.1
    Size of files: 68 KiB
    Homepage: https://jupyter.org
    Description: Core common functionality of Jupyter projects
    License: BSD

  • dev-python/jupyter_jsmol
    Latest version available: 0.2.4-r1
    Latest version installed: 0.2.4-r1
    Size of files: 6,162 KiB
    Homepage: https://github.com/fekad/jupyter-jsmol
    Description: jupyter jsmol widget viewer
    License: BSD

  • dev-python/jupyter_packaging [ Masked ]
    Latest version available: 0.10.4
    Latest version installed: [ Not Installed ]
    Size of files: 22 KiB
    Homepage: https://jupyter.org
    Description: Tools to help build and install Jupyter Python packages
    License: BSD

  • dev-python/jupyter_server [ Masked ]
    Latest version available: 1.8.0
    Latest version installed: [ Not Installed ]
    Size of files: 399 KiB
    Homepage: https://jupyter.org
    Description: Core services, APIs, and REST endpoints to Jupyter web applications
    License: BSD

  • dev-python/jupyter_server_mathjax [ Masked ]
    Latest version available: 0.2.3
    Latest version installed: [ Not Installed ]
    Size of files: 2,536 KiB
    Homepage: https://jupyter.org
    Description: MathJax resources as a Jupyter Server Extension
    License: BSD

  • dev-python/jupyterlab_pygments
    Latest version available: 0.1.2
    Latest version installed: 0.1.2
    Size of files: 549 KiB
    Homepage: https://github.com/jupyterlab/jupyterlab_pygments
    Description: Pygments theme making use of JupyterLab CSS variables
    License: BSD

  • sci-visualization/jupyter-dash [ Masked ]
    Latest version available: 0.4.0
    Latest version installed: [ Not Installed ]
    Size of files: 42 KiB
    Homepage: https://plotly.com/dash/
    Description: Plotly Dash apps from within Jupyter environments
    License: MIT

[ Applications found : 11 ]`

@kiwifb
Copy link
Collaborator

kiwifb commented Jul 15, 2021

It looks like a network configuration problem on your machine. Do you have some kind of firewall running?

@DrBanana419
Copy link
Author

It looks like a network configuration problem on your machine. Do you have some kind of firewall running?

I didn't explicitly install a firewall, so no.

@kiwifb
Copy link
Collaborator

kiwifb commented Jul 15, 2021

Have you ever run a standard jupyter notebook on that machine (i.e. not a sagemath kernel but a python or possibly other kernel)?

@DrBanana419
Copy link
Author

Have you ever run a standard jupyter notebook on that machine (i.e. not a sagemath kernel but a python or possibly other kernel)?

I have done it on another Linux distribution, but not on Gentoo.

@kiwifb
Copy link
Collaborator

kiwifb commented Jul 15, 2021

You should be able to do so with jupyter notebook on the command line, I am curious to see if it will behave differently.

@DrBanana419
Copy link
Author

You should be able to do so with jupyter notebook on the command line, I am curious to see if it will behave differently.

Unfortunately jupyter notebook returns the same errors.

@kiwifb
Copy link
Collaborator

kiwifb commented Jul 15, 2021

Which means it is not a sage specific problem, as I expected. Can you post the content of /etc/hosts and possibly the result of ip address?

@DrBanana419
Copy link
Author

DrBanana419 commented Jul 15, 2021

These are the contents of /etc/hosts (minus the comments):

127.0.0.1	localhost
::1		        localhost
127.0.1.1	my-linux-pc.localdomain	my-linux-pc

And this is ip address:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether a8:a1:59:3c:87:65 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.4/24 brd 192.168.0.255 scope global dynamic noprefixroute enp4s0
       valid_lft 4798sec preferred_lft 4798sec
    inet6 fe80::b545:860e:c7f5:5fb4/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

By the way I tried jupyter notebook --ip="0.0.0.0" and that worked.

@kiwifb
Copy link
Collaborator

kiwifb commented Jul 15, 2021

Then sage -n jupyter --ip="0.0.0.0" may work, although I must say I am confused by the fact that address works. Shows my ignorance on network stuff I guess.

@DrBanana419
Copy link
Author

I think that this should be kept open since workarounds like this should not be needed.

@kiwifb
Copy link
Collaborator

kiwifb commented Jul 15, 2021

If you wish, but you should seek assistance from a jupyter help channel. They are more likely to figure out the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants