Skip to content Skip to sidebar Skip to footer

Pycharm Unresolved Reference For Module Members

I have a flask app that I'm developing in PyCharm on MacOS. When I try to import the flask current app like this: from flask import current_app as app I get an inspection error: U

Solution 1:

I opened a ticket with JetBrains support, and after a long investigation they found the issue.

Somehow my __init__.py files got associated with text files, and that broke the resolver. I fixed it by going to Settings | Editor | File Types | Text | Registered patterns and deleting __init__.py from the registered patterns.

Thank you JetBrains for the great support!


Solution 2:

I tried the solution that the user nobody suggested. However, the file __init__.py was not within the Registered Patterns in the Text file type.

I searched lot of similar questions and also tried their suggestions but nothing worked. So I came up with the idea to add __init__.py into the --> Settings | Editor | File Types | Python | Registered patterns

Ss

And the unresolved reference error is now solved.


Post a Comment for "Pycharm Unresolved Reference For Module Members"