PyCharm not flagging undefined variables


I can say

x = ujhjkhhhuj

and it has no problem with that. It should tell me that `ujhjkhhhuj` is not defined. I have all of the inspections turned on and the interpreter set. What could be going on?


Okay, I had to remove the interpreter and re-add it.


that did the trick (well, I instead switched to a different interpreter in "Settings > Project > Python Interpreter"; saved; then switched back).


Dang, I have the same problem and google sent me back here again. This time, removing and re-adding the interpreter isn't working.

Update: actually, that check somehow got turned off. Weird.


Just started to get this when changing the interpreter from Python 3.6 to 3.7. Very weird and annoying.

Changed the Interpreter and then back and this did not help at all. Switching back to the previous interpreter did not fix this either. Seems I am stuck with a broken pycharm config.

When I place the cursor on the undefined variable and try "Go to declaration or usages" I get the tooltip message "no declaration to go to".

Using Pycharm 2021.2.3 CE


I even removed the whole .idea directory and created the config from scratch without success.

Turns out that removing the __pycache__ directories made the errors get shown again.


Same issue here.  Tried adding and removing the interpreter.  Invalidated caches.  Deleted all __pycache__ directories.  Running Pycharm 2021.3.3 Professional with Python 3.9.7.


same issue, deleted all __pycache__ dirs, removed and readded interpreter but issue persists.

PyCharm 2023.1.1 (Professional Edition)
Build #PY-231.8770.66, built on April 27, 2023

Python 3.8.13


Hello Pankaj Koti


please submit an issue  at  , attach a couple of screenshots and log from 

***Help | Collect logs and Diagnostic Data***


Thank you! 


Please sign in to leave a comment.