且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Docker容器中将Spyder连接到远程Jupyter Notebook

更新时间:2022-11-30 11:40:25

这不是一个解决方案,但sshfs可能会有所帮助

This isn't a solution so much as a work around, but sshfs might be of help

使用sshfs将远程计算机的主目录挂载在本地目录上,然后您的Spyder本地副本可以像对待本地文件一样编辑该文件.

Use sshfs to mount the remote machine's home directory on a local directory, then your local copy of Spyder can edit the file as if it were a local file.

sshfs remotehost.com:/home/user/ ./remote-host/

当您在Spyder中单击保存时,通常需要大约半秒钟将更改上传到AWS主机,这对我来说是可以接受的延迟.当需要运行代码时,请使用ssh进入远程计算机,然后从IPython shell运行代码.它不优雅,但确实可以.

It typically takes about half a second to upload the changes to an AWS host when you I hit save in Spyder, which is an acceptable delay for me. When it's time to run the code, ssh into the remote machine, and run the code from an IPython shell. It's not elegant, but it does work.

我不希望这是***的答案,但是也许您可以将其用作权宜之计.

I'm not expecting this to be the best answer, but maybe you can use it as a stopgap solution.