Pycharm debugger does not stop on breakpoints

24,609

Solution 1

Sometimes this might be caused by the fact that some other module is using the same tracing api (sys.settrace) as debugger, for instance Coverage.py. The solution would be to go to your Rub/Debug Configurations and add --no-cov flag to the Additional Arguments.

Alternatively you might want to delete all --cov in pytest settings (i.e. pytest.ini) or run tests with --no-cov flag, i.e.

    pytest test.py --no-cov

It might be also caused by a bad filename, e.g. your file/directory has special characters or spaces in it. Try removing them or changing to e.g. underscore (_).

Solution 2

There is an issue with the debugger in PyCharm lately. I'm on mac using PyCharm 2020.2 and while the debugger would stop at tests, it wouldn't stop when running the dev server for django.

For me disabling Gevent compatible option in Preferences > Build, Execution, Deployment has helped. enter image description here

Worth noting that some suggest to enable some suggest to disable that option - so it's worth having a go at each and see if that helps your case.

Solution 3

Just need set flask's debug mode off, such as

app.run(debug=False)

Solution 4

I didn't have a flask project but I had the same problem. In my case I had to change the project-path! There were umlauts (ü,ä,ö) in it. By removing them the breakpoints worked again.

Solution 5

Check your python debugger settings, and clear your cache, This helped me


enter image description here

Share:
24,609
Ved
Author by

Ved

Server Junkie at EA

Updated on July 21, 2022

Comments

  • Ved
    Ved almost 2 years

    I have a flask project I am trying to debug (this was working absolutely ok till few hours ago) - When I debug the project, I see the following :

    Connected to pydev debugger (build 135.1057)
    /Users/vantani/cp/bin/python /Applications/PyCharm.app/helpers/pydev/pydevd.py --multiproc --save-  
    signatures --client 127.0.0.1 --port 49223 --file /Users/vantani/cp/unnamed/manage.py server
    pydev debugger: process 484 is connecting
    
    /Users/vantani/cp/lib/python2.7/site-packages/flask_cache/__init__.py:152: UserWarning: Flask-  
    Cache: CACHE_TYPE is set to null, caching is effectively disabled.
    warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
    * Running on http://127.0.0.1:5000/
    * Restarting with reloader
    pydev debugger: process 498 is connecting
    

    As I said this setup was working fine. Now, the debugger does not stop at the breakpoint and the debugger window is empty. I see that there are two processes created by PyDev and I guess that is causing this issue. I have restarted my machine and there is only one pycharm process running.