When I am checking my modules through mypy it gives me this error:
Module 'django.contrib.gis' has no attribute 'forms'
and I am importing forms like this:
from django.contrib.gis import forms
I know it is correct but mypy shows this error message.
I could import like this:
from django.contrib import gis and use forms as gis.forms but I do not want to.
Can anyone help me to fix this? Thanks.
It appears that your problem is similar to this issue raised in mypy's github repo:
wherein the author of the issue originally ran mypy with the following line
RUN mypy --strict ./mypackage/tests.py
and solved the problem by running mypy by adding on the --implicit-reexport flag as follows:
RUN mypy --strict --implicit-reexport ./mypackage/tests.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With