django - mypy 和 django:错误:没有为“六”安装库存根(或与 Python 3.9 不兼容)
问题描述
我已经为 django 项目设置了 mypy
[mypy]
# The mypy configurations: https://mypy.readthedocs.io/en/latest/config_file.html
python_version = 3.9
check_untyped_defs = True
# disallow_any_explicit = True
disallow_any_generics = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
ignore_errors = False
ignore_missing_imports = True
implicit_reexport = False
strict_optional = True
strict_equality = True
no_implicit_optional = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unreachable = True
warn_no_return = True
mypy_path = /home/user/app/backend_django/src
plugins =
mypy_django_plugin.main,
mypy_drf_plugin.main
[mypy.plugins.django-stubs]
django_settings_module = project.settings
现在我明白了
settings.py:21: error: Library stubs not installed for "six" (or incompatible with Python 3.9)
在settings.py
我正在导入six
那么如何解决这个错误。
我已经django-stubs
安装
解决方案
推荐阅读
- javascript - 安装后运行计算函数 - VUE
- socket.io - 使用 VMware Fusion 无法连接羽毛聊天远程访问
- c# - 使用接收 2 个参数的实体框架更新记录
- json - Angular 6 - 如何停止生成规范文件
- couchbase - Couchbase 索引和 N1QL 查询
- macos - 如何删除某个目录(在 Mac 终端中)-unix 中文件名的最后 n 个字符?
- java - 无法从 Jenkins 将工件部署到 Nexus 存储库
- python - 计算for循环中的迭代次数
- google-cloud-platform - Spark HBase 到 Google Dataproc 和 Bigtable 的迁移
- c++ - 如何通过指向非易失性的指针接收易失性?