我按照设置 ipython3 服务器的说明进行操作。
这是我的ipython_notebook_config.py
:
c.NotebookApp.ip = '*'
c.NotebookApp.certfile = u'/home/ed/.ipython/profile_default/ds.pem'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha512:..mykey...'
c.NotebookApp.port = 20000
当我启动笔记本时,这就是我得到的:
ipython3 notebook ~
[I 19:51:50.443 NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
[I 19:51:50.476 NotebookApp] Serving notebooks from local directory: /home/ed
[I 19:51:50.476 NotebookApp] 0 active kernels
[I 19:51:50.476 NotebookApp] The IPython Notebook is running at: https://[all ip addresses on your system]:20000/
[I 19:51:50.476 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation)
当我尝试从外部连接到这台机器时,出现错误:
[E 19:52:02.413 NotebookApp] Exception in callback (<socket.socket fd=5, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('0.0.0.0', 20000)>, <function wrap.<locals>.null_wrapper at 0x7f766269a488>)
Traceback (most recent call last):
File "/home/ed/.local/lib/python3.4/site-packages/tornado/ioloop.py", line 866, in start
handler_func(fd_obj, events)
File "/home/ed/.local/lib/python3.4/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/home/ed/.local/lib/python3.4/site-packages/tornado/netutil.py", line 265, in accept_handler
callback(connection, address)
File "/home/ed/.local/lib/python3.4/site-packages/tornado/tcpserver.py", line 239, in _handle_connection
do_handshake_on_connect=False)
File "/home/ed/.local/lib/python3.4/site-packages/tornado/netutil.py", line 501, in ssl_wrap_socket
context = ssl_options_to_context(ssl_options)
File "/home/ed/.local/lib/python3.4/site-packages/tornado/netutil.py", line 478, in ssl_options_to_context
context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))
ssl.SSLError: [SSL] PEM lib (_ssl.c:2536)
我已经在另外两台机器上设置了这个,我没有问题。我不知道出了什么问题,可能是缺少库或一些我看不到的字幕错误。
我在 Ubuntu 15.04 上使用 IPython 3.2.1.、Python 3.4.3。
有任何想法吗?