I am learning how to use PyDev Remote Debugging. I am encountering an erroneous error message.
I apply Remote Debugging to a HelloWorld python program on a remote machine that consists of:
#This program prints Hello, world!
import pydevd
pydevd.settrace('192.168.1.31')
print('Hello, world!')
The IP address is that of the machine running Eclipse/PyDev
On Eclipse I have a project with the following program:
#This program prints Hello, world!
import pydevd
pydevd.settrace()
print('Hello, world!')
I start the Debug Server on Eclipse and set a breakpoint at the print statement. The debug server then reports:
pydev debugger: Trying to add breakpoint to file that does not exist: /home/dnessett/eclipse-workspace/HelloWorld/HelloWorld.py (will have no effect).
However, when I run the program on the remote machine, the breakpoint (green highlighting) shows up and when I step over the breakpoint, the remote execution completes as expected.
As an aside, I don’t know why ‘import pydevd’ is showing an unresolved reference. I would appreciate any help fixing that as well.
dnessett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
6
Related to the stopping issue, it’s hard to diagnose without further information:
Can you provide:
- Where’s the code in the remote machine (where python is running)
- Where’s the code in the local machine (where you’re running Eclipse/PyDev)
As a note, adding pydevd.settrace
will make the program pause there even without a breakpoint.
My guess is that you need to set the Path Mapping in the to make it work as you intend in Preferences > PyDev > Debug > Path Mappings
. Search for “Path Mapping” in https://www.pydev.org/manual_adv_remote_debugger.html for more information.
Related to:
As an aside, I don’t know why ‘import pydevd’ is showing an unresolved reference. I would appreciate any help fixing that as well.
The fact that pydevd
doesn’t appear there is because you probably don’t have it installed in your python environment (usually I just ignore it as Eclipse will add it automatically when you run, although the message is there to know that it’ll fail if you run it out of Eclipse/PyDev).
5