I would like to add a breakpoint to a pydev project. I am using eclipse with the pydev plugin. I am running Windows 7. The file I want to debug is located at C:\cygwin\workspace\project\main.py .
When I attempt to add the breakpoint by double-clicking to the left of the line on which I want the breakpoint, the breakpoint appears to be visually present in the file, but then I get this error when I click debug:
pydev debugger: warning: trying to add breakpoint to file that does not exist: /workspace/project/C:\cygwin\workspace\project\main.py
Note that the file still appears to run fine both in debug and normal run modes. I can also run the file outside the ide by running python main.py.
I was actually able to get this working. I realize I’m using PyCharm, but the solution should be easily adapted since they both use PyDev. The basic problem is that the IDE is expecting windows paths while PyDev is expecting cygwin paths. I found the appropriate places in PyDev to do those conversions.
Here’s my setup
edit Program Files/JetBrains/PyCharm 2.5/helpers/pydev/pydevd.py. This converts the paths sent to the debugger to cygwin paths. Around line 597, where
file = NormFileToServer(file)is located, make the following changesdo the same filename conversion a few lines later under the
elif cmd_id == CMD_REMOVE_BREAKstatementedit Program Files/JetBrains/PyCharm 2.5/helpers/pydev/pydevd_comm.py. This converts paths sent back to pycharm into windows paths. Around line 549 alter the code to look like this:
Adjust the paths as needed. The big thing that helped me figure this out was to add
PYCHARM_DEBUG=Truein the environment variables of the PyCharm run/debug configurations.Hope this saves someone else the 6 hours I spent figuring this out!