When I step into a function and hit f7 I go to the threading module first


I have checked the box:


settings -> debugger -> stepped -> do not step into scripts -> threading.py


And pycharm still goes into the threading module each time I hit f7.  I need to figure out how to stop this.


Hi kyle,

Thank you for contacting PyCharm support.

Please clarify if you are using virtual env? If so, is it in the project?
Please attach a screenshot of `Project Interpreter -> Show All -> "Show paths for selected interpreter" window.

Kind regards,




Here are the screenshots.  Also, I had to add some folders to the content root otherwise red lines would appear under my modules even though the module were working fine.  A while back I had to delete Pycharm and redownload it because the skeletons took too long to generate.  When I redownloaded it I had to had some very strange folders to my content root so as to make the red lines under my modules go away.  I did not have to do that last time.  Now I regularly get alerts saying the my memory is low.  I'm wondering if all of those folder that I had to add to the content root is the cause of the low memory.  I'm also attaching screenshots for the f7 - threading.py error.



Hi kyle foley! Does it happen with every function or only with particular one? If it doesn't happen always, could you please provide us a code sample for reproducing the problem?

Also you can increase Memory Heap for PyCharm: https://www.jetbrains.com/help/idea/increasing-memory-heap.html



Yes, it happens every time I hit f7.  Even this simple code triggers the bug:


class hey():
def __init__(self, num):
self.you = num
def __call__(self, *args, **kwargs):
return self.you + args[0]

b = hey(2)

When I step into they class 'hey' I first go to the module threading.py. Also I tried altering my content root but that did not alter things.

Unfortunately, I can't reproduce the problem locally with your example. Do you use any exception breakpoints?


I've made a video of the problem here:




I found the cause of the problem but I'm not able to remove it. When I do module imports I will get red lines under the names of the modules unless I add certain folders to the content root. I don't remember having to do this with my last Pycharm app but I could be wrong. (I had to delete Pycharm and redownload it entirely from scratch due to a bug.)  When I remove those folders from the content root I will not enter the threading module but then red lines appear every in my code which is very distracting.  In the following photos is shown the folders I add to the content root. 

I also think that this puts a heavy strain on the memory of the program because I regularly get warnings saying my memory is almost full and I did not used to get those alerts.  In the following photo is shown the module which will go red if the library is removed from the content root.


And here is what happens if the library is removed from the content root.  On the other hand, I have moved a separate file to my desktop outside of the project structure and I do not go into the threading module when I hit f7 and also no red lines appear under the modules.  Here is a screenshot of the content root of that program.



Also I was able to find some of my old pycharm folders and I noticed that they have this .idea folder whereas my current one does not.  Might this be a cause of some of the problems?


Hi! Let's better not delete anything from content roots. Could you please configure new interpreter in your project, set environment variable PYCHARM_DEBUG=True, run debug session and save console output to file? After that could you please go to our issue tracker (https://youtrack.jetbrains.com/issues/PY), create a new issue and attach this file to the issue.
Thank you!


Please sign in to leave a comment.