1
votes

I want to use eclipse, pydev to remote debug my python script. Python script is on a remote Ubuntu server, and Eclispe/pydev is running on my Windows 7 machine.

I followed every step according to this one. http://pydev.org/manual_adv_remote_debugger.html

The problem is in the last step of configuring path in pydevd_file_utils.py on server, it does not recognize the change. This is what I changed:

PATHS_FROM_ECLIPSE_TO_PYTHON = [(r'c:\EZ_Green\plugins', r'/home/jiechao/EZ_Green/plugins')]

When I run the script, it gives me such error.

pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/jiechao/EZ_Green/plugins/D:/EZ Green/backend/getData.py (will have no effect)

Seems the change does not apply, has anyone done this before or have any ideas?

Thanks a lot

-----------------update 1--------------

So I solve the previous problem and now here is the new problem.

This is the output of program, and it seems the path configuration is correct. Debug Server at port: 5678 pydev debugger: replacing to server: D:\EZ Green\Product\EZ_Green\plugins\test.py pydev debugger: sent to server: /home/jiechao/EZ_Green/plugins\test.py pydev debugger: replacing to client: /home/jiechao/EZ_Green/plugins/test.py pydev debugger: sent to client: D:\EZ Green\Product\EZ_Green\plugins/test.py

But eclipse does not stop at the breakpoint, not even at pydevd.settrace() I have no idea why it does not stop. When I use remote debug on local machine, it works pretty well. When I want to debug on a remote server machine, it does not work. I don't know what's the problem.

------------------update 2---------------------

Problem solved. The script on my client and server turns out to be a little different. So I did not see the breakpoint it stopped. I am so stupid!

Thanks anyway.

1
From your comment, you put 'C:' and it says that 'D:' does not exist... could that be it? - Fabio Zadrozny
Yes, I change the path and there is no warning. But the new problem is when I add breakpoint in Eclispe, the program does not stop at the breakpoint. I don't know why. - Jiechao Li
Well, it's a bit too limited on info to answer that... it does at least stop on the pydevd.settrace() call right? - Fabio Zadrozny
Hi, Fabio. Please see my update on the question. It does not stop at the pydevd.settrace(), either. Thanks a lot. - Jiechao Li
Are you pointing the proper ip in the settrace() call? Do you have a firewall in place which may be preventing the communication? - Fabio Zadrozny

1 Answers

1
votes

Even though it is possibly not the exact approach you may expect, one option is to start the Unittest from the command line and attach the debugger by RemoteDebugServer via 'pydevd.py'.

This is now a fully automated option of ePyUnit which includes the automation of remote debugging with PyDev and Eclipse by 'pydevd.py'. This works seamlessly for 'subprocesses' as well as independently started command line processes.

The hostame and the port number could be varied as required, default is localhost:5678.

See:

For basics of remote debugging:

Also enhanced unittest integration into PyUnit.

Comments and fixes are welcome.

Have fun.