mypy "Skipping analyzing X: module is installed but missing stubs" in CI
mypy found the package installed but it ships no inline types and no py.typed marker, and no stub package is present. With strict settings this skip is reported as an error.
What this error means
mypy reports "Skipping analyzing 'X': module is installed, but missing library stubs or py.typed marker [import-untyped]," which fails the run when warnings are strict.
python
app/main.py:2: error: Skipping analyzing "yaml": module is installed, but
missing library stubs or py.typed marker [import-untyped]Common causes
The library has no inline types or py.typed
mypy treats an untyped, unmarked package as having no type info; in strict mode that is an error.
A stub package exists but is not installed
Many libraries have a community types-* stub package that must be installed separately.
How to fix it
Install the stub package
- Find the matching
types-*package for the library. - Install it in the mypy environment.
- Re-run mypy.
Terminal
pip install types-PyYAML
mypy app/Ignore untyped imports for that module
When no stubs exist, silence the specific module rather than disabling import checks globally.
pyproject.toml
[[tool.mypy.overrides]]
module = ["untyped_lib.*"]
ignore_missing_imports = trueHow to prevent it
- Install
types-*stub packages for your untyped dependencies. - Scope
ignore_missing_importsper module, not globally. - Keep stub packages pinned alongside the libraries they describe.
Related guides
mypy "Cannot find implementation or library stub" in CIFix mypy "Cannot find implementation or library stub for module" in CI - mypy cannot locate a module or its t…
mypy "error: Module has no attribute" in CIFix mypy "error: Module X has no attribute Y" in CI - the type checker cannot find a name on a module, from m…
ruff "invalid rule selector" in CIFix ruff "error: invalid rule selector" in CI - a rule code in the config was removed, renamed, or never exis…