0

Trying to setup a Jupyter notebook server on personal machine with public IP and getting this error:

jupyter notebook --ip 69.84.109.70 --no-browser --port 8888

Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/jupyter_core/application.py", line 270, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py", line 663, in launch_instance
    app.initialize(argv)
  File "</usr/local/lib/python3.7/dist-packages/decorator.py:decorator-gen-7>", line 2, in initialize
  File "/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/notebook/notebookapp.py", line 1769, in initialize
    self.init_webapp()
  File "/usr/local/lib/python3.7/dist-packages/notebook/notebookapp.py", line 1490, in init_webapp
    self.http_server.listen(port, self.ip)
  File "/usr/local/lib/python3.7/dist-packages/tornado/tcpserver.py", line 151, in listen
    sockets = bind_sockets(port, address=address)
  File "/usr/local/lib/python3.7/dist-packages/tornado/netutil.py", line 174, in bind_sockets
    sock.bind(sockaddr)
OSError: [Errno 99] Cannot assign requested address

When I run it with my internal IP address it works fine.

Config file:

cat /home/user/.jupyter/jupyter_notebook_config.

c.NotebookApp.allow_origin = '*' #allow all origins
c.NotebookApp.ip = '0.0.0.0' # listen on all IPs
Goose
  • 2,130
  • 10
  • 32
  • 43
  • Did you read this?: https://stackoverflow.com/questions/19246103/socket-errorerrno-99-cannot-assign-requested-address-and-namespace-in-python/19267994 – Prateek Dewan Feb 19 '20 at 22:20

1 Answers1

0

Use the following command to run your jupyter notebook

jupyter notebook --ip=0.0.0.0 --port=8080
DevScript
  • 68
  • 1
  • 6
  • 1
    For us newbies, can you provide some explanation of what setting the `--ip` to `0.0.0.0` does? What is the purpose of this? What IP gets assigned in that case? Or does this instruct it to bind to all available IPs? Again, some explanation would be useful. – Jeremy Caney May 14 '20 at 19:41