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
As discovered in jaraco/skeleton#188, attempting to run mypy under PyPy fails with "no module named 'librt'".
To Reproduce
Install latest mypy and PyPy.
pypy -m mypy {some codebase}
Expected Behavior
Should run as it did a few weeks ago.
Actual Behavior
tempora main 🐚 .tox/pypy/bin/mypy .
Traceback (most recent call last):
File "/Users/jaraco/code/jaraco/tempora/.tox/pypy/bin/mypy", line 5, in <module>
from mypy.__main__ import console_entry
File "/Users/jaraco/code/jaraco/tempora/.tox/pypy/lib/pypy3.10/site-packages/mypy/__main__.py", line 9, in <module>
from mypy.main import main, process_options
File "/Users/jaraco/code/jaraco/tempora/.tox/pypy/lib/pypy3.10/site-packages/mypy/main.py", line 17, in <module>
from mypy import build, defaults, state, util
File "<frozen importlib._bootstrap>", line 1078, in _handle_fromlist
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/jaraco/code/jaraco/tempora/.tox/pypy/lib/pypy3.10/site-packages/mypy/build.py", line 31, in <module>
from librt.internal import cache_version
ModuleNotFoundError: No module named 'librt'
Your Environment
Mypy version used: 1.19.1
Mypy command-line flags: None
Mypy configuration options from mypy.ini (and other config files): None
Python version used: Python 3.10.14 (39dc8d3c85a7, Nov 09 2024, 22:49:03) [PyPy 7.3.17 with GCC Apple LLVM 16.0.0 (clang-1600.0.26.4)]
Is it likely that it will be resolved in a few days, or would you recommend implementing the above solution with the pinning so that the CI pipeline is up and running again quickly?
(And thanks to everyone working on mypy for this great tool.)
Hm, I thought with my recent PR it should fail more gracefully. Btw what is the reason to run mypy using PyPy? Most likely it will be slower than CPython (with compiled binaries) and type-checking results will be identical with CPython.
Activity
jaraco commentedon Dec 21, 2025
Attempting to install mypy 1.19.0 fails to compile librt.
jaraco commentedon Dec 21, 2025
Pinning to mypy<1.19 on PyPy seems to work around the issue.
Pin mypy on PyPy.
hauntsaninja commentedon Dec 21, 2025
Yeah, librt doesn't support PyPy.
See also #20329 (comment) and mypyc/librt#16 (comment)
A5rocks commentedon Dec 21, 2025
Wait librt starting building? Sorry, missed the difference in 1.19.1 vs 1.19.0.
HeWeMel commentedon Dec 23, 2025
I think I have the same problem (https://github.com/HeWeMel/nographs/actions/runs/20466071430/job/58810049765#step:6:23).
Is it likely that it will be resolved in a few days, or would you recommend implementing the above solution with the pinning so that the CI pipeline is up and running again quickly?
(And thanks to everyone working on mypy for this great tool.)
ilevkivskyi commentedon Dec 23, 2025
Hm, I thought with my recent PR it should fail more gracefully. Btw what is the reason to run mypy using PyPy? Most likely it will be slower than CPython (with compiled binaries) and type-checking results will be identical with CPython.
Move PyPy check before mypy imports (#20465)
ilevkivskyi commentedon Dec 23, 2025
It should now fail with a more helpful error message. The PyPy support itself will be tracked in #20329
Properly fix Python 3.13 mypy support
Try with mypy<1.19
mypy versions 1.19.0 and 1.19.1 do not work with pypy due python/mypy…
AVRO-4232: [Python] Modernize the Python tooling (#3658)
Pin mypy on PyPy.
Pin mypy on PyPy.
AVRO-4232: [Python] Modernize the Python tooling (apache#3658)
AVRO-4232: [Python] Modernize the Python tooling (apache#3658)