Debugger doesn't stop at break points

Viewed 2732

When I start debugging (hitting the bug button to top-right), it gets connected and below message is shown:

Connected to pydev debugger (build 172.3968.37)

But it doesn't stop at break points. Can anyone help me with this problem?

I am using PyCharm CE on a Mac with python 3.6.2

2 Answers

Possibilities:

  1. An unhandled exception was raised by code long before we ever got to the code containing a breakpoint. That is, the code which gets executed before the code containing a break-point contains an error.

  2. The code containing a break-point is never executed, even when the script runs from start to finish. For example, if the break-point is inside an if-block and the condition of the if-statement is never true, then the breakpoint will never be reached.

  3. You are not running the script you think you are running. Look in the upper right corner of the UI. What is the name of the file next to the run button (green triangle)?

A possibility is that when you run the debugger it will try to connect to the same server IP and port as one you've already got running.

So for example, if you've already run

python manage. runserver

in one terminal window, it will run a server at, say,

 http://127.0.0.1:8000/

but when the debugger is run, it will also try to connect to the same IP & port. The debugger console would then say

Error: That port is already in use.

When you refresh the browser, it won't stop at the breakpoint, because the debugger is not connected. So it could be as simple as closing the connection to the server in the first terminal and restarting the debugger.

Related