我的大学有一台Linux机器,校园里有强大的Jupyter。以下是我通过Windows笔记本电脑登录远程服务器并在服务器上运行Jupyter笔记本的步骤,可以通过ssh隧道在我的本地浏览器上进行编辑,但它总是给我同样的错误:
Ssh –L 8000(on my laptop):localhost:8889(on remote server) <MyUserID>@<RemoteServerIP>
source $HOME/anaconda3/bin/activate
conda activate <env_name>
jupyter notebook
要么
jupyter notebook --no-browser --port=8889
[I 09:04:06.122 NotebookApp] Writing notebook server cookie secret to /run/user/148037468/jupyter/notebook_cookie_secret
[I 09:04:06.881 NotebookApp] Serving notebooks from local directory: <directoryname>
[I 09:04:06.881 NotebookApp] The Jupyter Notebook is running at:
[I 09:04:06.881 NotebookApp] http://localhost:8889/
[I 09:04:06.881 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 09:05:10.507 NotebookApp] 302 GET / (::1) 1.43ms
localhost:8000
它将我重定向到登录页面,我在jupyter笔记本中成功查看了我的目录,然后单击.ipynb文件它在终端上给出以下错误:
The signatures database cannot be opened; maybe it is corrupted or encrypted. You may need to rerun your notebooks to ensure that they are trusted to run Javascript. The old signatures database has been renamed to <directory_name>.local/share/jupyter/nbsignatures.db.bak and a new one has been created.
[W 09:17:35.807 NotebookApp] Failed commiting signatures database to disk.
You may need to move the database file to a non-networked file system, using config option `NotebookNotary.db_file`. Using in-memory signatures database for the remainder of this session.
[W 09:17:35.811 NotebookApp] Notebook plots1.ipynb is not trusted
[W 09:17:35.881 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20190319090406 (::1) 17.39ms referer=http://localhost:8000/notebooks/plots1.ipynb
[I 09:17:36.430 NotebookApp] Kernel started: 242b529a-5acd-4b5f-8a6d-356947ab30d2
[W 09:18:36.467 NotebookApp] Timeout waiting for kernel_info reply from 242b529a-5acd-4b5f-8a6d-356947ab30d2
/<directory_name>/anaconda3/envs/braingrid/lib/python3.6/site-packages/notebook/base/zmqhandlers.py:284: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
[W 09:18:38.276 NotebookApp] Replacing stale connection: 242b529a-5acd-4b5f-8a6d-356947ab30d2:dd09ca5465ba404a886c71b3ca787d6b
[W 09:21:36.370 NotebookApp] Notebook plots1.ipynb is not trusted
[IPKernelApp] ERROR | Failed to open SQLite history /<directory_name>/.ipython/profile_default/history.sqlite (database is locked).
[IPKernelApp] ERROR | History file was moved to /<directory_name>/.ipython/profile_default/history-corrupt.sqlite and a new file created.
Jupyter笔记本不断显示:
"Connecting to terminal"
我不知道如何解决这个问题。我是Linux新手。 sudo命令都不起作用,因为我不是admin /或具有这些权限
这个设置对我的论文是必要的。
这可能是问题所在:您的笔记本存储签名(https://jupyter-notebook.readthedocs.io/en/stable/security.html),告诉浏览器在打开笔记本时是否信任任何javascript和html。它将它们存储在SQLite数据库中。看来如果这个数据库文件在NFS上,可能会出现锁定问题:
因此,将文件移动到服务器上的本地文件夹可能会有效,并将NotebookNotary.db_file
指向那里。