gpt4 book ai didi

ssh - 通过ssh隧道连接到远程IPython Notebook服务器的错误

转载 作者:行者123 更新时间:2023-12-02 13:51:34 29 4
gpt4 key购买 nike

这是我所做的:

   remote.server$ ipython notebook --no-browser --port=8889
local$ ssh -v -N -L localhost:8888:localhost:8889 remote.server

然后,我尝试使用 localhost:8888启动它。但是在远程服务器上,有此错误:
[E 21:41:40.853 NotebookApp] Uncaught exception in write_error
Traceback (most recent call last):
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/tornado/web.py", line 976, in send_error
self.write_error(status_code, **kwargs)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 315, in write_error
html = self.render_template('%s.html' % status_code, **ns)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 253, in render_template
ns.update(self.template_namespace)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 263, in template_namespace
logged_in=self.logged_in,
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 95, in logged_in
user = self.get_current_user()
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 83, in get_current_user
return self.login_handler.get_user(self)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/auth/login.py", line 70, in get_user
user_id = handler.get_secure_cookie(handler.cookie_name)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/tornado/web.py", line 637, in get_secure_cookie
self.require_setting("cookie_secret", "secure cookies")
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/tornado/web.py", line 1294, in require_setting
"application to use %s" % (name, feature))
Exception: You must define the 'cookie_secret' setting in your application to use secure cookies

网页上没有任何内容。我为另一台服务器做了同样的事情,并且它起作用了。该服务器有什么问题以及如何解决?

我正在使用miniconda的虚拟环境。这些版本是:
ipython                   3.2.1                    py27_0  
ipython-notebook 3.2.1 py27_0
jinja2 2.7.3 py27_1
tornado 4.2 py27_0
zeromq 4.0.5 0

最佳答案

我已通过阅读Jupyter笔记本官方文档解决了此问题。

1.运行

    jupyter notebook --generate-config

2.然后你会得到
    jupyter_notebook_config.py

在“.jupyter”中。

3.打开
    jupyter_notebook_config.py

和写
    c.NotebookApp.cookie_secret = b'anything'

它会工作

关于ssh - 通过ssh隧道连接到远程IPython Notebook服务器的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31397856/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com