I have PyDev running on Eclipse on my Mac and I want to run a script on a Linux server but connecting to the PyDev debugger on my local machine.
My computer is in an external network in respect to the server (I would be at home and the server in the lab), and the Python environments are very different (the server has GPU and my computer does not). How do I connect to the PyDev debugger on Eclipse on MacOS from a Linux server?
I know that I have to start the debugger server on Eclipse, that I have to set pydevd.settrace() on both files (local and remote) and that they have to be the same. Plus, I know that I can define the port to connect and the user (pydevd.settrace('localhost', port=5678, suspend=False)). But so far I did not manage to connect the server to my Mac. Also, the paths of the files are different and I have to edit pydevd_file_utils.py but I am not sure how to.
If you just pass the ip of the machine you're connecting to in pydevd.settrace
after starting the debug server on PyDev
(as http://www.pydev.org/manual_adv_remote_debugger.html explains), you should at least see the debugger connected (this would be the first step -- if it's not working, some firewall is blocking the communication -- note that if you have an internal IP you may need to do use ssh tunneling).
After you see it there, you should work on setting a PATHS_FROM_ECLIPSE_TO_PYTHON
environment variable on the server following the comments on https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd_file_utils.py.
-- hint: making DEBUG_CLIENT_SERVER_TRANSLATION=True
by editing that file (pydevd_file_utils.py
) on your own server can give you hints on how translations are taking place.