Unused imports not highlighted
Hi,
For several versions of PyCharm now, I have noticed that the unused imports are not highlighted. Maybe I might just need to change something in the preferences. The only thing I could find in the prefs that looks like it is the "unused symbol" in the colors&fonts prefs. But as you can see in the attached screenshot, there is already a wavy yellow underlined for that one. That underline does not appear for unused Python imports though.
Am I missing something?
Many thanks,
Julien
Attachment(s):
Unused Imports.png
Please sign in to leave a comment.
To have unused import highlighting, you need to have the "Unresolved references" inspection enabled in Settings | Inspections.
Great, thank you!
This is often referenced as "Unused imports" so maybe it'd be good to rename the preference "Unresolved references and unused imports" or something like that, so it's easy to find.
Thank you,
Julien
Hello Julien,
http://youtrack.jetbrains.net/issue/PY-2111
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi,
I have Inspect -> Unresolved References turned on, and Highlight Level is set to "All Problems", but Pycharm 2021.1 is not highlighting unused imports. (It's also not highlighting undefined references, like variable "y" on line 7). This worked fine in Pycharm 2020 but stopped working when I upgraded to 2021.
I had the same problem for the longest time. Make sure "reader mode" is disabled. I think this did it for me!
Thank you, Michal
It worked for me. It is just in the top right corner and if you click it it will disable Reader Mode and then it works.
Michal method just works. I appreciate it.