Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm debugger does not stop on breakpoints

Tags:

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.

like image 601
Ved Avatar asked Dec 10 '14 12:12

Ved


People also ask

How do I stop PyCharm debugging?

Terminate a debugger sessionClick the Stop button in the Debug tool window. Alternatively, press Ctrl+F2 and select the process to terminate (if there are two or more of them).

How do I stop a Debug session?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.

Why does Visual Studio not stop at breakpoint?

This problem occurs because ASP.NET debugging isn't enabled on the application.

Do breakpoints stop before or after line?

The breakpoint will stop your program just before it executes any of the code on that line.


2 Answers

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 (_).

like image 89
Tomasz Bartkowiak Avatar answered Oct 18 '22 11:10

Tomasz Bartkowiak


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.

like image 40
slajma Avatar answered Oct 18 '22 11:10

slajma