PyCharm not flagging undefined variables

Completed

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?

6 comments
Comment actions Permalink

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

1
Comment actions Permalink

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

0
Comment actions Permalink

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.