[Python] PyCharm unresolved reference on import

Discussão em 'Python' iniciado por Stack, Maio 7, 2025.

  1. Stack

    Stack Membro Participativo

    Why does PyCharm underline these imports:

    from oauth2_helper import (_url, get_token, get_session)
    from config import scope


    as Unresolved reference, but if I add dots in front:

    from .oauth2_helper import (_url, get_token, get_session)
    from .config import scope


    I don't get the error underline in PyCharm; then when running my app from the terminal, I get this error:

    ModuleNotFoundError: No module named '__main__.oauth2_helper'; '__main__' is not a package

    Why is this happening?

    Continue reading...

Compartilhe esta Página