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

with jupyter_notebook_config.py can't start the jupyter #718

Closed
mattshma opened this issue Sep 21, 2018 · 11 comments
Closed

with jupyter_notebook_config.py can't start the jupyter #718

mattshma opened this issue Sep 21, 2018 · 11 comments

Comments

@mattshma
Copy link

mattshma commented Sep 21, 2018

When I copy the jupyter_notebook_config.py to $HOME/.jupyter/, I can't start the jupyter notebook:

jovyan@11821ce44fe1:~/.jupyter$ jupyter notebook

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/traitlets/traitlets.py", line 528, 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/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 869, in _default_allow_remote
    addr = ipaddress.ip_address(self.ip)
  File "/usr/lib/python3.5/ipaddress.py", line 54, in ip_address
    address)
ValueError: '' 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/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 1629, in initialize
    self.init_webapp()
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 1379, in init_webapp
    self.jinja_environment_options,
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 158, in __init__
    default_url, settings_overrides, jinja_env_options)
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 251, in init_settings
    allow_remote_access=jupyter_app.allow_remote_access,
  File "/usr/local/lib/python3.5/dist-packages/traitlets/traitlets.py", line 556, in __get__
    return self.get(obj, cls)
  File "/usr/local/lib/python3.5/dist-packages/traitlets/traitlets.py", line 535, in get
    value = self._validate(obj, dynamic_default())
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 872, in _default_allow_remote
    for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM):
  File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

If I delete $HOME/.jupyter/jupyter_notebook_config.py, it could works!

jovyan@11821ce44fe1:~/.jupyter$ jupyter notebook
localhost
[I 16:40:07.658 NotebookApp] Serving notebooks from local directory: /home/jovyan/.jupyter
[I 16:40:07.659 NotebookApp] The Jupyter Notebook is running at:
[I 16:40:07.659 NotebookApp] http://localhost:8888/?token=fdb986edc6d44936d03fbf18b25fcf1b966a7922e1df8b45
[I 16:40:07.659 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 16:40:07.659 NotebookApp] No web browser found: could not locate runnable browser.
[C 16:40:07.659 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=fdb986edc6d44936d03fbf18b25fcf1b966a7922e1df8b45

my python env as follows:

jovyan@11821ce44fe1:~/.jupyter$ python
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jupyter
>>> import notebook
>>> print(jupyter.__version__)
1.0.0
>>> print(notebook.__version__)
5.7.0

I find jupyter/notebook#3754 have some problem, but I had updated my notebook..

Any helps?

@mattshma
Copy link
Author

mattshma commented Sep 21, 2018

I find c.NotebookApp.ip = '*' cause this problem. when I change c.NotebookApp.ip from * to 0.0.0.0, the jupyter could start.

@avinson
Copy link
Contributor

avinson commented Oct 3, 2018

@mattshma you should re-open this because it's still broken without the workaround

@parente
Copy link
Member

parente commented Oct 3, 2018

Fixed in #721

@rituraj17
Copy link

I find c.NotebookApp.ip = '*' cause this problem. when I change c.NotebookApp.ip from * to 0.0.0.0, the jupyter could start.

not working

@Franselbaer
Copy link

Please double check if you have anywhere a startup script with --ip="*" and change it to --ip="0.0.0.0". It really helps.

@Franselbaer
Copy link

What a good idea to change that in minor release without deprecated warning... 🙄

@dimitri320
Copy link

This still doesn't solve the error when you're running Jupyter on AWS. Any ideas what can fix it?

@vizhuddar
Copy link

This still doesn't solve the error when you're running Jupyter on AWS. Any ideas what can fix it?

Commenting line "-----.ip = '*'" in jupyter config file worked for me.

@milensys
Copy link

I have the same issue.

File "/home/ec2-user/anaconda3/bin/jupyter-notebook", line 11, in
sys.exit(main())
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "", line 2, in initialize
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 1628, in initialize
self.init_webapp()
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 1378, in init_webapp
self.jinja_environment_options,
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 159, in init
default_url, settings_overrides, jinja_env_options)
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 252, in init_settings
allow_remote_access=jupyter_app.allow_remote_access,
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py", line 556, in get
return self.get(obj, cls)
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 867, in _default_allow_remote
for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM):
File "/home/ec2-user/anaconda3/lib/python3.7/socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

@Mjvolk3
Copy link

Mjvolk3 commented Oct 30, 2020

I have the same issue. Any new solutions?

@romainx romainx changed the title with jupyter_notebook_config.py cann't start the jupyter with jupyter_notebook_config.py can't start the jupyter Nov 5, 2020
@romainx
Copy link
Collaborator

romainx commented Nov 5, 2020

@Mjvolk3 could you please give a reproducible example, as things have changed since this issue was opened.
Many thanks

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

10 participants