PyCharm 2020.1 not stopping on breakpoints anymore.
Hi guys,
PyCharm Professional 2020.1 is not stopping on breakpoints for me anymore, when I test my project with pytest and run tests in debug mode. I already wiped out my .idea/ directory to start all over, already tried checking and unchecking "gevent support", and none of these options make the debugger honor the breakpoints.
Can somebody help me?
Guys, this is super frustrating. It's been many versions already with the IDE having troubles with non-stopping breakpoints, and this is a very important part of the process for a number of developers, including myself. For me, it's actually the most important feature, because I debug code a LOT, both when running and testing, and having the debugger stopping to work as expected makes the experience a nightmare for me.
Can you please address more effort into fixing this recurring issue?
Thank you,
Diogo
请先登录再写评论。
I had this problem in the last few days. I'm using PyCharm 2020.2 (Professional Edition) Build #PY-202.6397.98.
The problem was coverage related, so, as soon as I removed coverage code snippet from the Flask app, all the breakpoints worked again.
```
ccov = coverage.coverage(
branch=True,
include="project/*",
omit=[
"project/tests/*",
"project/server/config.py",
"project/server/*/__init__.py",
],
)
ccov.start()
```
The 'bug' was completely reproducible. Add the code back in, breakpoints don't work. REM the code out, breakpoints work as expected.
Thanks to all contributors for the tips on this and helping with diagnosis and resolution. Good job.
Same Issue, Pycharm 2020.2 breaking points not stopping at all for Django project files.
For me, it started after the last Catalina update (10.15.6) PyCharm community version 2020.2.
It stopped on breakpoints in the main process (Django app), but not in other threads (in my case - celery worker).
I solved the issue by turning on the "Gevent compatible" option in the Python debugger.
I know that some people before me wrote the issue was resolved after they turned it off, but for some (currently unknown) for me it worked while turning it on...
I have come across this issue today. Installed a fresh version of Pycharm professional on my new machine. Out of no where Pycharm started ignoring the breakpoints.
Folks, this is getting ridiculous, I'm getting many comments from people having the same issue, and it hasn't been fixed for several versions already. Why isn't this being prioritized? Debugging is one of the most important features in the IDE, it should be working fine. I don't care if a color of a word is incorrect, or if it fails to do some refactoring it was supposed to, but I care a lot about debugging with the IDE, instead of having to textually define breaking points within ipdb.
And it's even more irritating for paying users, like myself (and probably others).
I agree with Diogobaeder . Today remove all components IDE, Python, formatting Notebook and not success.
Re-install PyCharm 2020.2 now and Python + Django, unfortunately my debug didn't work again and without solutions in fórum.
Well, I am not renewing my Pro version subscription unitl this issue is properly resolved. My workaround (somewhere above) is working for me sometimes, but sometimes not (ie. on a different machine) ....
This suddenly started happening for me, and I finally figured out the problem. I recently needed to debug some celery tasks. In order to do that, I had to enable gevent compatibility. This broke pycharm's debugger when debugging normal applications. So in case you might have enabled this by accident, look in Settings -> Build, Execution, Deployment -> Python Debugger and make sure `Gevent compatible` is deselected
I hope that helps
Hi Brian,
That solution had already been mentioned before, but it doesn't solve all cases. The debugger is still broken and needs to be fixed by the PyCharm developers.
Sergey Karpov any news on this issue? It has been going on for months now, and it's one of the fundamental features in the IDE.
Thanks,
Diogo
This happened to me too today on Pycharm 2020.2.2 (community edition) in Windows 10. It happened after I ran some code coverage checks (outside of pycharm environment) which created a .coverage file in my project root directory. While the file was there, debugger breakpoitns set in the editor would not work but the breakpoint() command would still function. After deleting the .coverage file the debugging breakpoints worked again.
same pb, delete .idea, test with ou without gevent compatible, no explication, some breakpoint are ok and some is ignored.
pro version and nobody to fix a big functionality, give me a bad image of jetbrains :-(
I'm really soryy because i have no time to give you example, you have a lot of comments, you should try to understand the problem, especially beacause the version is paid
Hello Sandrine Suire,
Please feel free to submit a ticket at https://youtrack.jetbrains.com/issues/PY with attached project example and steps to reproduce the issue.
Thank you in advance !
@joost was correct in his assertion that the problem began in 2019.3.
I walked back each installation starting from latest 2020 down to 2019.2.6. The breakpoint issue was introduced in 2019.3 and does not occur (for us) in 2019.2.6.
We isolated our issue of breakpoints not stopping only in local python modules imported into our main module, which did not reside in the root directory with the main module itself.
For example:
Breakpoints will work in the main module of:
\My_Project_Folder\main.py
However, if we import:
\My_Project_Folder\Subfolder\submodule.py
into main.py
Breakpoints WILL stop in main.py, but will NOT stop in submodule.py
If we move submodule.py out of \Subfolder\ and place it in the root (\My_Project_Folder\), breakpoints will work again in submodule.py.
I've had problems with this for a while. I've tried all the suggested solutions that I've found (including removing .idea, removing .pytest cache, disabling cython with environment variables - even though I haven't installed cython, removing the .coverage*-files, uninstalling any coverage-related packages, etc.). What I found to finally work was to add a line with `breakpoint()` in my code. With that in my code all my breakpoints started working as I expected. Almost as if pycharm wasn't really in debug mode until I added a line with `breakpoint()`. What is weird though is that breakpoints in my test fixtures worked, but not in the actual test that I ran.
Hello Thamilton and Stian,
It seems like code specific, as I am not able to reproduce this with a simple example. Please provide me with a project example and steps to reproduce ( to the FTP
https://uploads.jetbrains.com/ and please let me know the filename. )
Also having the problem where debugger set by placing break-point in left-column does not break.
Recommendation by @Thiagof back on 1 Sept is what worked for me.
Select Module vs. Script in the configuration. Not sure why this works as the Python file I'm running is _not_ in a directory with a __init__.py.
I was facing the exact same issue, on pycharm pro 2020.3, with cython speedups installed on a pretty regular django project on Python 3.8.5
Of all the things suggested in this and other threads the only thing that fixed it for me, and I was able to isolate it as the sole fix, was what Bkrupa78 suggested, which was disabling the "Gevents compatible" option in the Python debugger settings.
I'm having the same issue. Please help. I've unchecked "Gevents compatible" option and still cannot get the breakpoint to break. I'm running in a Docker container in Professional Edition.
* No threading
* Python 7.9.1
* macOS 11.1
Just in case, I'll remind that each case may be different, and the best way to resolve it is to submit an issue to https://youtrack.jetbrains.com/issues/py with the following information:
1. Code/project sample
2. Steps to reproduce the issue (where to place the breakpoint)
3. Information about your interpreter
4. Logs from **Help | Collect Logs and Diagnostic Data**
You can also add `PYCHARM_DEBUG=True` env variable to your run/debug configuration, and provide debug console output.
This grave bug is now relatively old and there were several updates since first bug report. Bug still exists in 2020.3. PLEASE fix this bug soon!!! It is really super frustrating. Debugging is really hard.
Just here to parrot everyone else's dissatisfaction, I feel like I'm wasting my money.
Hi folks,
Lately I've been consistently able to work around the bug by disabling code coverage tools during testing - not sure how to get rid of it during dev execution for example, as each case might be different (you can try enabling or disabling gevent support, for example). Anyways, for testing it seems to me that adding code coverage makes breakpoints be ignored, and I have no idea why. So, if in your case you've been having the same issue during automated test running, then try to disable code coverage tools, like pytest-cov for example, and see if then the breakpoints stop the execution as expected.
Cheers,
Diogo
For me, before my folder name is “assignments”, I renamed it to “Assignments”. The app still runs, but won't stop at breakpoints when debug.
After I updated it to correct “Assignments”, the debug can stop at breakpoints again.
Hope this helps some people. I think it would be great for JetBrains team notify user the folder name not match.
Same issue here. Seems in my case to be related to the coverage module.
It happened all of a sudden but if I remove the coverage module it works!
it is possible to work around for me but very annoying.
Just ran into this issue with 2021.1.1 CE and a brand new project. Reading through this thread is like reading a black magic book, everyone has their own voodoo $h!t :) My solution was to change the default test runner to pytest.
I'm seeing similar behavior after migrating a project from django 2.1.15 to django 2.2.24
If I check the `no reload` option in the Run Configuration it debugs just fine, but I have to manually restart the debugger to pickup code changes.
The big change from Django 2.1 to Django 2.2 is Watchman Support https://docs.djangoproject.com/en/2.2/ref/django-admin/#:~:text=DJANGO_WATCHMAN_TIMEOUT%20environment%20variable.-,Changed%20in%20Django%202.2%3A,Watchman%20support%20replaced%20support%20for%20pyinotify.,-When%20you%20start
After spending a day and a half trying every solution on the web with no success, I was able to fix the issue by uninstalling and reinstalling PyCharm and restarting my computer
In my case adding random things like `print('a')` somewhere around the breakpoint and the debugger will work normally while removing them cause the breakpoints to get ignored again.
My project doesn't have anything to do with webservice btw.
Hi all,
I also faced a similar issue where the debugger skips breakpoints. After trying a lot of different suggestions discussed in this and other threads on this topic, I found the solution to my problem. I will share it for anyone who's interested, and to avoid people running into this problem as well.
I am using SQLAlchemy a lot for a project. Sometimes the query is a bit long, and to make it readable, I often use some statements in the form of:
Apparently, if you set the breakpoint on the line of `object` the debugger does not understand this and skips it somehow. Here is some code to reproduce the problem:
Put a breakpoint on the `y` line and on the `z` line. You will notice when running the debugger that it skips the first and stops at the second.
Hope this helps.
Here: Ubuntu 20.04, PyCharm 2021.2.1, Python 3.9
Solved for me.
Here's what I just experienced: