Skip to content

Mypy suggests types-Pygments but --install-types doesn't install it #21068

Description

@rentruewang

Bug Report

(A clear and concise description of what the bug is.)
See below.

To Reproduce

Do from pygments.lexers import ....

mypy file.py would gives:

(3.14) ➜ git: mypy .
error: Library stubs not installed for "pygments.lexers"  [import-untyped]
note: Hint: "python3 -m pip install types-Pygments"
note: (or run "mypy --install-types" to install all missing stub packages)
note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
error: Library stubs not installed for "pygments"  [import-untyped]

Normally for other packages I would fix by mypy --install-types [--non-interactive] ..

But it doesn't install types-Pygments despite mypy knowing that this stub is missing.

# Ideally, a small sample program that demonstrates the problem.
# Or even better, a reproducible playground link https://mypy-play.net/ (use the "Gist" button)

Expected Behavior

Actual Behavior

Your Environment

  • Mypy version used: mypy 1.19.1 (compiled: yes)
  • Mypy command-line flags: See above
  • Mypy configuration options from mypy.ini (and other config files): No
  • Python version used: Python 3.14.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions