我正在尝试使用服务器IP地址从远程服务器使用Jupyter笔记本,并遵循以下SO问题的建议:
Why I can't access remote Jupyter Notebook server?
以下命令在所有服务器实例中均有效,但我遇到一个特定实例的问题:
jupyter notebook --ip xx.xx.xx.xx --port 8889 --allow-root
在此特定的服务器实例中,这将引发以下错误:
File "/root/anaconda3/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/root/anaconda3/lib/python3.8/site-packages/jupyter_core/application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/root/anaconda3/lib/python3.8/site-packages/traitlets/config/application.py", line 663, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/root/anaconda3/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/root/anaconda3/lib/python3.8/site-packages/notebook/notebookapp.py", line 1769, in initialize
self.init_webapp()
File "/root/anaconda3/lib/python3.8/site-packages/notebook/notebookapp.py", line 1490, in init_webapp
self.http_server.listen(port, self.ip)
File "/root/anaconda3/lib/python3.8/site-packages/tornado/tcpserver.py", line 151, in listen
sockets = bind_sockets(port, address=address)
File "/root/anaconda3/lib/python3.8/site-packages/tornado/netutil.py", line 174, in bind_sockets
sock.bind(sockaddr)
OSError: [Errno 99] Cannot assign requested address
尽管在jupyter_notebook_config.py上进行了以下设置,但问题似乎出在IP地址而不是端口上
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.allow_origin = '*'
c.NotebookApp.allow_remote_access = True
我已经研究了SO和Github上的解决方案,其中大多数是针对localhost而不是特定IP地址的。
有人可以指出问题所在吗?谢谢。