Search code examples
pythondockerpycharmpython-typing

Pycharm - Type hints are not installed


I keep getting this warning in PyCharm 2018.3.5: "Type hints are not installed".

enter image description here

If I click 'Install', a log message like this appears:

6:11 PM Packages installed successfully: Installed packages: 'djangorestframework-stubs'

But then the warning reappears in a few minues. How to fix it? If it matters, I have a remote Docker Compose interpreter configured for the project, which is otherwise working fine.


Solution

  • I created a ticket in PyCharm's bug tracker about this problem: https://youtrack.jetbrains.com/issue/PY-34624

    What basically happens:

    1. PyCharm finds djangorestframework installed and proposes to install a stub package for it as djangorestframework-stubs is missing
    2. You click Install
    3. PyCharm starts the container and installs djangorestframework-stubs there
    4. PyCharm stops the container
    5. Now djangorestframework-stubs is gone
    6. Repeat from 1.