简体   繁体   English

如何在 VSCode 中使用远程 Jupyter 服务器?

[英]How to use a remote Jupyter server in VSCode?

I want to use a remote Jupyter server via SSH with VSCode but I get an error whenever I try to specify the URI of any server.我想通过 SSH 和 VSCode 使用远程 Jupyter 服务器,但是每当我尝试指定任何服务器的 URI 时都会出错。 This also happens with local instances of Jupyter. Jupyter 的本地实例也会发生这种情况。 Any server that is not started by VS Code seems to be unusable.任何不是由 VS Code 启动的服务器似乎都无法使用。

I am just starting a server like this我刚刚开始这样的服务器

$ jupyter notebook --no-browser --port 8080

Then I enter the address in VSCode with the correct port and token然后我用正确的端口和令牌在 VSCode 中输入地址http://localhost:8080/?token=...

Nothing happens and I get this error, as you can see in the log below.什么都没有发生,我收到了这个错误,你可以在下面的日志中看到。

Command 'Python: Specify local or remote Jupyter server for connections' resulted in an error (Running the contributed command: 'python.datascience.selectjupyteruri' failed.)命令“Python:为连接指定本地或远程 Jupyter 服务器”导致错误(运行贡献的命令:“python.datascience.selectjupyteruri”失败。)

VSCode 控制台日志

Has anyone else been experiencing anything similar?有没有其他人经历过类似的事情? I honestly have no idea how to troubleshoot this.老实说,我不知道如何解决这个问题。 It is worth noting that selecting the Default: VS Code will automatically start a server for you on localhost option raises the same error.值得注意的是,选择Default: VS Code will automatically start a server for you on localhost选项会引发同样的错误。

It looks like you're running a fairly old version of the Python extension, as the python.datascience.selectjupyteruri command no longer exists in the Python extension—it is now provided in a standalone Jupyter extension .看起来您正在运行 Python 扩展的相当旧版本,因为python.datascience.selectjupyteruri命令不再存在于Python 扩展中。 Please consider upgrading to the latest version of the Python and Jupyter extensions.请考虑升级到最新版本的 Python 和 Jupyter 扩展。 If that doesn't resolve the problem, please file an issue at https://github.com/microsoft/vscode-jupyter/issues and we'll be happy to help.如果这不能解决问题,请在https://github.com/microsoft/vscode-jupyter/issues提出问题,我们很乐意提供帮助。

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

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