1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] PyCharm Not Properly Recognizing Requirements - Python, Django

Discussão em 'Python' iniciado por Stack, Setembro 11, 2024.

  1. Stack

    Stack Membro Participativo

    Often requirements show up in requirements.txt like this:

    django-registration

    But in INSTALLED_APPS it appears as registration. So when you import like:

    from registration.signals import user_registered


    This is valid but PyCharm is showing a red squiggly line under the word registration in from registration... that says "Package 'registration' is not listed in project requirements".

    How can I remedy this?

    UPDATE

    I was able to find a way to make the warning go away but it's not a good solution. If you simply add the package name to the requirements.txt file the warning goes away, but then that requirement is not valid if you were to install with pip. For example, I'm also using pygooglevoice which is how it's written in requirements.txt but when it's imported in the code, you write:

    from googlevoice import Voice


    This seems weird because I use PyCharm for many projects and I'm just noticing this with a recent project I'm working on...

    Continue reading...

Compartilhe esta Página