Skip to content

Execute remote scripts in remote kernels under local Spyder #3065

@samotracio

Description

@samotracio

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions