简体   繁体   English

使用VSCode连接到Jupyter实例

[英]Connecting to Jupyter Instance with VSCode

I have a running Google Deep Learning VM, I set up an SSH tunnel and when I navigate to http://localhost:8080 , I am connected to the running Jupyter Lab instance. 我有一个正在运行的Google深度学习VM,我建立了一个SSH隧道,当我导航到http:// localhost:8080时 ,我已连接到正在运行的Jupyter Lab实例。 Running the command sudo service jupyter status , tells me that the service is running correctly. 运行命令sudo service jupyter status ,告诉我该服务正在正确运行。

Now, I want to connect to the Jupyter instance with Visual Studio Code. 现在,我想使用Visual Studio Code连接到Jupyter实例。 I tried [Ctrl]+[Shift]+[P] and "Python: Specify Jupyter server URI" and entered http://localhost:8080 in the resulting prompt. 我尝试了[Ctrl] + [Shift] + [P]和“ Python:指定Jupyter服务器URI”,并在出现的提示中输入了http:// localhost:8080 However, I get an error message: 但是,我收到一条错误消息:

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.

Unfortunately, the documentation does not say very much . 不幸的是, 文档并没有说太多

Has anybody experience with connecting VSCode to a remote server? 有任何将VSCode连接到远程服务器的经验吗? Thank you. 谢谢。

Aparently, you have to set a password. 显然,您必须设置一个密码。 I followed the instructions here to create a hashed password. 我按照此处的说明创建了哈希密码。 Then I edited my jupyter_notebook_config.py file and edited the line c.NotebookApp.password = '<my_super_secret_hash>' . 然后,我编辑了jupyter_notebook_config.py文件,并编辑了c.NotebookApp.password = '<my_super_secret_hash>' Eventually, I could connect with VSCode. 最终,我可以连接VSCode。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM