@@ -648,8 +648,18 @@ the issue:
648
648
649
649
.. _code-import :
650
650
651
- Check that import target can be found [import]
652
- ----------------------------------------------
651
+ Check for an issue with imports [import]
652
+ ----------------------------------------
653
+
654
+ Mypy generates an error if it can't resolve an `import ` statement.
655
+ This is a parent error code of `import-not-found ` and `import-untyped `
656
+
657
+ See :ref: `ignore-missing-imports ` for how to work around these errors.
658
+
659
+ .. _code-import-not-found :
660
+
661
+ Check that import target can be found [import-not-found]
662
+ --------------------------------------------------------
653
663
654
664
Mypy generates an error if it can't find the source code or a stub file
655
665
for an imported module.
@@ -658,11 +668,31 @@ Example:
658
668
659
669
.. code-block :: python
660
670
661
- # Error: Cannot find implementation or library stub for module named 'acme' [import]
662
- import acme
671
+ # Error: Cannot find implementation or library stub for module named "m0dule_with_typo" [import-not-found ]
672
+ import m0dule_with_typo
663
673
664
674
See :ref: `ignore-missing-imports ` for how to work around these errors.
665
675
676
+ .. _code-import-untyped :
677
+
678
+ Check that import target can be found [import-untyped]
679
+ --------------------------------------------------------
680
+
681
+ Mypy generates an error if it can find the source code for an imported module,
682
+ but that module does not provide type annotations (via :ref: `PEP 561 <installed-packages >`).
683
+
684
+ Example:
685
+
686
+ .. code-block :: python
687
+
688
+ # Error: Library stubs not installed for "bs4" [import-untyped]
689
+ import bs4
690
+ # Error: Skipping analyzing "no_py_typed": module is installed, but missing library stubs or py.typed marker [import-untyped]
691
+ import no_py_typed
692
+
693
+ In some cases, these errors can be fixed by installing an appropriate
694
+ stub package. See :ref: `ignore-missing-imports ` for more details.
695
+
666
696
.. _code-no-redef :
667
697
668
698
Check that each name is defined once [no-redef]
0 commit comments