Spyder, Run script located on remote server

The path for the %run magic needs to be the path that the server sees, not the client. You are passing the path from the client’s perspective.

When you type run Z:/blah/blah/blah.py, your terminal sends that path to the IPython server to execute. The server looks for the path Z:/blah/blah/blah.py, but since it doesn’t exist on the server, the command fails with a file not found error.

The easiest solution is to just run the command with the path the server expects:

%run /path/to/blah/on/server/blah.py


Bottom line: remember that the server cannot access files that the client terminal is running on.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)