关于python:运行jupyter笔记本时ec2 ubuntu名称或服务未知错误

ec2 ubuntu name or service unknown error when running jupyter notebook

我正在使用ec2和ubuntu 18机器,并希望安装jupyter笔记本,我按照本教程并不断收到此错误:

Traceback (most recent call last): File
"/home/ubuntu/.local/bin/jupyter-notebook", line 11, in
sys.exit(main()) File"/home/ubuntu/.local/lib/python3.6/site-packages/jupyter_core/application.py",
line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File
"/home/ubuntu/.local/lib/python3.6/site-packages/traitlets/config/application.py",
line 657, in launch_instance
app.initialize(argv) File"",
line 2, in initialize File
"/home/ubuntu/.local/lib/python3.6/site-packages/traitlets/config/application.py",
line 87, in catch_config_error
return method(app, *args, **kwargs) File"/home/ubuntu/.local/lib/python3.6/site-packages/notebook/notebookapp.py",
line 1628, in initialize
self.init_webapp() File"/home/ubuntu/.local/lib/python3.6/site-packages/notebook/notebookapp.py",
line 1378, in init_webapp
self.jinja_environment_options, File"/home/ubuntu/.local/lib/python3.6/site-packages/notebook/notebookapp.py",
line 159, in init
default_url, settings_overrides, jinja_env_options) File"/home/ubuntu/.local/lib/python3.6/site-packages/notebook/notebookapp.py",
line 252, in init_settings
allow_remote_access=jupyter_app.allow_remote_access, File"/home/ubuntu/.local/lib/python3.6/site-packages/traitlets/traitlets.py",
line 556, in get
return self.get(obj, cls) File"/home/ubuntu/.local/lib/python3.6/site-packages/traitlets/traitlets.py",
line 535, in get
value = self._validate(obj, dynamic_default()) File"/home/ubuntu/.local/lib/python3.6/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"/usr/lib/python3.6/socket.py", line 745,
in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known

端口22和8888对我的IP开放

我在这做错了什么?


当我使用conda而不是python以相同的方式运行它时,它可以工作