question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Execute remote scripts in remote kernels under local Spyder

See original GitHub issue

I 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:open
  • Created 8 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mdhabercommented, Jul 15, 2019

+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!

0reactions
pilotjoecommented, Sep 22, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spyder: How to edit a python script locally and execute it on a ...
1 under Windows 7 and have a running iPython 2.3 Kernel on a Rasperry Pi RASPBIAN Linux OS. I can connect to an...
Read more >
Seamless remote IPython kernel debugging with Spyder IDE
Finally, in Spyder, under the “Consoles” tab, select “Connect to an existing kernel”, browse to select your connection file, check “This is a ......
Read more >
IPython Console — Spyder 3 documentation
Spyder IPython Console with code, inline plots, and the In prompt ... Launch an IPython kernel on the local or remote host if...
Read more >
Spyder IDE : How do i remote into a kernel. e.g. from my pc to ...
The steps below are confirmed to work using Spyder 3.1.4 IDE on a Debian Jessie or Ubuntu Xenial, to connect on a Raspberry...
Read more >
remote-kernel - PyPI
This allows a locally running instance of Jupyter or Spyder to easily run code on a remote server. Moreover, this can be installed...
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found