You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider recommending types-lxml instead of lxml-stubs in import-untyped hint #20187
The import-untyped hint for lxml recommends installing lxml-stubs. The lxml-stubs README seems to recommend the types-lxml fork instead, though:
This repository contains external type annotations (see PEP 484) for the lxml package.
NOTE: It was superceded by the more complete and externally maintained types-lxml fork.
It seems better to recommend types-lxml to users, but it might be more risky for use with --install-types because it is a third-party package.
To Reproduce
importlxml
Actual Behavior
a.py:1: error: Library stubs not installed for "lxml" [import-untyped]
a.py:1: note: Hint: "python3 -m pip install lxml-stubs"
a.py:1: note: (or run "mypy --install-types" to install all missing stub packages)
a.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
#19101 installs lxml-stubs for mypy's self-check; if that PR is accepted and then this issue is decided in favor of types-lxml then perhaps it will be a good idea to change that dep to types-lxml. Although probably not a highly pressing concern.
Hi! There have been some new developments, in that the lxml-stubs repo is now marked unmaintained in its README and archived on Github (referring to types-lxml as replacement, as already indicated in the OP).
It seems better to recommend types-lxml to users, but it might be more risky for use with --install-types because it is a third-party package.
Regardless of whether to actively recommend types-lxml or not, would it at least be possible to stop recommending the long obsolete lxml-stubs? This way, users would at least not (semi-)automatically get a known-bad package.
Activity
wyattscarpenter commentedon Nov 23, 2025
#19101 installs lxml-stubs for mypy's self-check; if that PR is accepted and then this issue is decided in favor of types-lxml then perhaps it will be a good idea to change that dep to types-lxml. Although probably not a highly pressing concern.
Wuestengecko commentedon Jul 6, 2026
Hi! There have been some new developments, in that the
lxml-stubsrepo is now marked unmaintained in its README and archived on Github (referring to types-lxml as replacement, as already indicated in the OP).Regardless of whether to actively recommend
types-lxmlor not, would it at least be possible to stop recommending the long obsoletelxml-stubs? This way, users would at least not (semi-)automatically get a known-bad package.