Execute remote scripts in remote kernels under local Spyder
See original GitHub issueI am trying to edit and run a script.py located in a remote server using a local Spyder running in a laptop.
I was able to successfully connect to the remote kernel running in the server and after mounting the remote directory using sshfs in a local folder in the laptop, Spyder can read and modify script.py with no problems.
However, using “Run” from the menu does not work (and for some reason uses %run instead of runfile())
In[1]: %run "/home/uzer/someLocalDir/script.py"
ERROR: File `'/home/uzer/someLocalDir/script.py'` not found
I understand this fails because that path is only locally defined, while in the server the code is in a different location , say “/home/uzer/some/remote/dir/script.py”
Is it possible to access the full path of the currently selected file in the Spyder editor (that is, the string “/home/uzer/someLocalDir/script.py”) ? Mi idea is to implement a custom magic such as %remote_run, that takes this string, translates the directory structure from local to remote, and finally does %run real-remote-path . I know is not the best solution, but might work for specific cases.
Apologizes if this sounds more like a question than a actual issue report.
- Spyder Version: 2.3.8
- Python Version: 3.5.1
- Anaconda 2.5 (64-bit)
- Operating system: OpenSuse 13.1
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (4 by maintainers)

Top Related StackOverflow Question
+1 on this, I think. Setting up a SciPy development environment in Windows is tricky, but setting one up in Windows Subsystem for Linux (WSL) is relatively easy. From Spyder on Windows, I can connect to a Python kernel running on WSL, but I’m having trouble editing/running files that live on WSL (like SciPy source files). I can browse for them, but when I try to open them nothing happens.
I’ve also tried running Spyder on WSL and using XMing to see the GUI, but no luck.
Any workarounds in the meantime would be appreciated!
I’m eagerly awaiting this enhancement too. One thought is that you could add a dialog to the “Connect to an existing kernel” dialog asking for an optional “Remote path”. If the user populates this field, you could use this as the basis for the runfile path and debug file path, Maybe down the road it could be added to File->Open, File->Save etc, but I imagine this would be a lot more work.