jupyter notebook: return getattr(self._sock,name)(

2019-07-15 06:41发布

问题:

Hi I want to run the jupyter notebook on the cloud Ubuntu server(16.04). and the server IP is 213.138.10.176 (just example), and port is 22011 I have installed jupyter, and python 2.07, and edited the jupyter_notebook_config.py as following:

   c.NotebookApp.ip = '213.138.10.176'
   c.NotebookApp.open_browser = False
   c.NotebookApp.port = 22011

But after I saved it, and run jupyter notebook command on the Ubuntn server. there is error:

     File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/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/python2.7/dist-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 1296, in initialize
    self.init_webapp()
  File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 1120, in init_webapp
    self.http_server.listen(port, self.ip)
  File "/usr/lib/python2.7/dist-packages/tornado/tcpserver.py", line 126, in listen
    sockets = bind_sockets(port, address=address)
  File "/usr/lib/python2.7/dist-packages/tornado/netutil.py", line 182, in bind_sockets
    sock.bind(sockaddr)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address

Thanks for your help!