PyCharm not debugging into new Thread

I'm using PyCharm Community Edition 2020.1.2 on Windows 10 and I try to debug a Python 3.7 Toga project, created with the BeeWare 'briefcase new' command. The app is set up as a module and I can debug into it, until I get to Toga.App.main_window.main_loop(). There, a new thread for the app execution is created and the app's main window is displayed.

The debugger stops there and waits for the main_loop() to end and no breakpoint in my app code has any effect. Then, when main_loop ends, debugging resumes. But I want to debug the newly created thread, because that is where my app code is actually executed. I would have expected to see the new Thread under 'Frames',so that I could change to this thread to continue debugging. But under 'Frames', I first only see 'MainThread' and when main_loop() is executed, there is nothing in 'Frames' anymore until I close the app's main window. Then, again, 'MainThread' is displayed.

This is the code executed in main_loop():

def main_loop(self):
  thread = Threading.Thread(Threading.ThreadStart(self.run_app))

Debugging works fine for apps using tkinter for example. A colleague told me that Toga debugging is working on his Mac but he has the same problem under Windows.

Please help


I am experiencing the same issue with PyCharm Pro. My app is not using any threading whatsoever. I tried debugging the same app on both macOS and Windows 10. On macOS, I can debug normally, but on Windows 10, PyCharm ignores my breakpoints.


pycharm pro debug is freezing when starting a new thread , using tkinter as GUI. 2020.1.4. It seems to be intermittent.  I will submit a ticket 


I would suggest trying 2020.2 first and then submit a ticket if the issue is still there.


thanks, tried that , same behaviour. Simple example sent me by support works fine, so something specific to my code. what it is doing is creating a tkinter window  to monnito progress of a job in the main thread (all that tkinter will allow) , then creating another thread to run the job in. on switching to that, everything freezes. I will continue dialog with support 


I'm seeing the same thing on the latest build .

PyCharm 2020.2.3 (Professional Edition)

I used to be able to debug threads it seems since updating to 2020 I have had issues.  This is very inconvenient and really need this working like it used to work.


try putting : 




in environment variables ... as suggested to me by support ... worked for me 


I had issues with debugger not stopping in threaded code, but I resolved it by going to `File | Settings | Build, Execution, Deployment | Python Debugger` and un-ticking "Gevent compatible". Hope this helps


For me was opposite it helped when I checked "Gevent compatible"


None of these suggestions seem to work for me with PyCharm 2023.3 (PY-233.11799.259, built on December 3, 2023) when running the debugger with Python spawning threads with breakpoints in them.


Scott Ballard please create a new request on YouTrack so we can investigate this one further


Please sign in to leave a comment.