-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pandas-stubs resulting in mypy to fail at initialization #1019
Comments
I wasn't able to repro:
Do you have a mypy config file or something? |
For me, this issue occurs when follow imports is set to "error" (or "skip"), i.e. |
@hauntsaninja I was able to reproduce in a clean environment, python 3.12, mypy 1.13.0 with latest
|
Sounds like python/mypy#17396 (Obligatory note: while this is certainly a bad bug, in my experience most people using a non-default value of |
Closing this issue here as it is a |
Thanks everyone! It is indeed a --follow-imports issue due to numpy2.0.0 (managed to reproduce the same error on my end). |
Describe the bug
mypy is unable to run with the following error when pandas-stubs is installed. The error is as following:
Traceback (most recent call last):
File "/code/.venv/bin/mypy", line 8, in
sys.exit(console_entry())
^^^^^^^^^^^^^^^
File "/code/.venv/lib/python3.11/site-packages/mypy/main.py", line 15, in console_entry
main()
File "mypy/main.py", line 102, in main
File "mypy/main.py", line 186, in run_build
File "mypy/build.py", line 194, in build
File "mypy/build.py", line 269, in _build
File "mypy/build.py", line 2935, in dispatch
File "mypy/build.py", line 3333, in process_graph
File "mypy/build.py", line 3460, in process_stale_scc
File "mypy/build.py", line 2497, in write_cache
File "mypy/build.py", line 1559, in write_cache
File "mypy/nodes.py", line 390, in serialize
File "mypy/nodes.py", line 4010, in serialize
File "mypy/nodes.py", line 3947, in serialize
File "mypy/nodes.py", line 3371, in serialize
File "mypy/types.py", line 682, in serialize
File "mypy/types.py", line 2475, in serialize
File "mypy/types.py", line 1498, in serialize
File "mypy/types.py", line 682, in serialize
File "mypy/types.py", line 3160, in serialize
AssertionError: Internal error: unresolved placeholder type None
When pandas-stubs is uninstalled, the following result will be seen:
Success: no issues found in 1 source file
When a different command is ran with pandas-stubs installed, the following result will be seen:
Success: no issues found in 1 source file
To Reproduce
mypy -c 'import pandas as pd'
- this will failmypy -c 'import os'
- this will passPlease complete the following information:
pandas-stubs
- pandas-stubs-2.2.3.241009Additional context
pre-commit is working but likely it is due to not having pandas-stubs installed.
Likely not a pandas-stubs issue, but just want to point out that it is also frustrating that the above error did not proper tracebacks to know that pandas-stubs was the library that caused it - I had trial and error with many individual scripts to reproduce it efficiently.
The text was updated successfully, but these errors were encountered: