python - 使用 VSCode 连接到 Jupyter 实例

标签 python visual-studio-code jupyter google-dl-platform

我有一个正在运行的 Google 深度学习虚拟机,我设置了一个 SSH 隧道,当我导航到 http://localhost:8080 时,我已连接到正在运行的 Jupyter Lab 实例。运行命令 sudo service jupyter status 告诉我该服务正在正确运行。

现在,我想使用 Visual Studio Code 连接到 Jupyter 实例。我尝试了 [Ctrl]+[Shift]+[P] 和“Python:指定 Jupyter 服务器 URI”并输入 http://localhost:8080在出现的提示中。但是,我收到一条错误消息:

Failed to connect to remote Jupyter notebook.
Check that the Jupyter Server URI setting has a valid running server specified.
http://localhost:8080/
Error: Failed to connect to password protected server. Check that password is correct.

不幸的是,documentation does not say very much

有人有将 VSCode 连接到远程服务器的经验吗?谢谢。

最佳答案

显然,您必须设置密码。 我按照说明here进行操作创建散列密码。然后我编辑了我的jupyter_notebook_config.py文件并编辑行 c.NotebookApp.password = '<my_super_secret_hash>' 。最终,我可以连接 VSCode。

关于python - 使用 VSCode 连接到 Jupyter 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56852835/

相关文章:

python - 列表中对象的名称?

git - 使用分支名称在 vs 代码中添加提交消息的前缀

python - 如何腌制或存储 Jupyter (IPython) 笔记本 session 以供以后使用

Python functools lru_cache 与实例方法 : release object

python - 我如何有效地测试这个 Django 模型?

python - Anaconda 未能通过 md5 检查更新?

c++ - 在 Visual Studio Code 中编译 C++ 代码

intellisense - 基于文件中单词的VS Code自动完成

python - %load filename.py 命令在 Jupyter 笔记本中的哪里查找?

python - 如何使用Python的PID查看Python正在读取或编辑哪些文件?