【问题标题】:Trouble with Jupyter certificationsJupyter 认证问题
【发布时间】:2019-03-11 10:46:31
【问题描述】:

我在连接到 AWS 上的 Jupyter 笔记本实例时遇到了问题。这有点超出我的驾驶室,所以任何帮助将不胜感激!

ubuntu@ip-172-31-20-132:~$ export XDG_RUNTIME_DIR=""
ubuntu@ip-172-31-20-132:~$ jupyter notebook
[I 22:04:19.553 NotebookApp] JupyterLab extension loaded from /home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 22:04:19.553 NotebookApp] JupyterLab application directory is /home/ubuntu/anaconda3/share/jupyter/lab
[I 22:04:19.557 NotebookApp] Serving notebooks from local directory: /home/ubuntu
[I 22:04:19.557 NotebookApp] The Jupyter Notebook is running at:
[I 22:04:19.557 NotebookApp] https://(ip-172-31-20-132 or 127.0.0.1):8888/?token=fdef54981e6ae03e4f7a59276436982ff7ed1f28c7714901
[I 22:04:19.557 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 22:04:19.558 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        https://(ip-172-31-20-132 or 127.0.0.1):8888/?token=fdef54981e6ae03e4f7a59276436982ff7ed1f28c7714901
Exception in callback BaseAsyncIOLoop._handle_events(7, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(7, 1)>
Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 122, in _handle_events
    handler_func(fileobj, events)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/netutil.py", line 262, in accept_handler
    callback(connection, address)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/tcpserver.py", line 263, in _handle_connection
    do_handshake_on_connect=False)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/netutil.py", line 565, in ssl_wrap_socket
    context = ssl_options_to_context(ssl_options)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/netutil.py", line 540, in ssl_options_to_context
    context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))
PermissionError: [Errno 13] Permission denied

【问题讨论】:

  • 您找到解决方案了吗?
  • 也有同样的问题,希望有人找到解决方法。找到了这个 github 问题,但似乎没有为我解决任何问题github.com/jupyter/notebook/issues/507

标签: python-3.x amazon-web-services anaconda jupyter-notebook jupyter


【解决方案1】:

所以我遇到了这个问题,这是由于您的 jupyter 配置文件中引用的证书文件存在权限问题。在 jupyter_notebook_config.py 中,我引用了 mycert.pem。我将 mycert.pem 的所有权更改为我的标准用户帐户。

sudo chown user:user ~/certs/mycert.pem

这解决了问题。

【讨论】:

  • 在一个 ec2 ubuntu 实例上,我将命令更改为 sudo chown $USER:$USER ~/certs/mycert.pem,它也能正常工作。感谢您的帮助
  • 我知道点赞就够了,但我真的必须说...谢谢! @GeochemB
【解决方案2】:

检查以下几项以确保您在 AWS EC2 机器上使用 jupyter notebook 时处理 permission error:-

1:确保不要使用private ip,而是使用public ip

2: 处理证书权限错误后出错

sudo chown $USER:$USER /home/ubuntu/certs/mycert.pem

3:处理SSL error,确保在ip:&lt;port number&gt;之前使用https://

4:请务必检查security groupinbound 规则,以确保您尝试正确访问ports

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-02
    • 2020-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-18
    相关资源
    最近更新 更多