尝试在VSCode中运行Mypy,总是在输出中得到相同的错误.
Django项目的根目录和工作区目录不同。
##########Linting Output - mypy##########
Error constructing plugin instance of NewSemanalDRFPluginpython3.8.5
Django与DRF
发布于 2020-07-29 10:25:58
PYTHONPATH必须包含django项目的根,或者必须从django项目的根调用Mypy。
发布于 2021-07-23 08:54:02
当将django-stubs和djangorestframework-stubs一起使用时,我得到了这个错误。它可能是其中一个库中的bug:https://github.com/typeddjango/django-stubs/issues/672
这是有解决办法的(小心,因为它可以隐藏其他错误)。运行mypy with ( -O参数禁用断言检查):
python -O -m mypy application/https://stackoverflow.com/questions/63150029
复制相似问题