Skip to content
Latchkey

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

  1. Find the matching types-* package for the library.
  2. Install it in the mypy environment.
  3. 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 = true

How to prevent it

  • Install types-* stub packages for your untyped dependencies.
  • Scope ignore_missing_imports per module, not globally.
  • Keep stub packages pinned alongside the libraries they describe.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →