mypy error: Skipping analyzing 'spacy.tokens': found module but no type hints or library stubs
See original GitHub issueNot a real bug - just static type checker being unhappy.
How to reproduce the behaviour
Create file tmp.py
from spacy.tokens import Doc
> mypy tmp.py ─╯
app.py:1: error: Skipping analyzing 'spacy.tokens': found module but no type hints or library stubs
Your Environment
Info about spaCy
- spaCy version: 3.0.0rc2
- mypy version: 0.79
- Platform: macOS-10.15.7-x86_64-i386-64bit
- Python version: 3.8.5
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Why is mypy finding "no type hints or library stubs" for any of ...
This error is because mypy was not able to find the module you are trying to import, whether it comes bundled with type...
Read more >Running mypy and managing imports
If you are getting a Skipping analyzing X: module is installed, but missing library stubs or py.typed marker , error, this means mypy...
Read more >mypy matploitlib: error: Skipping analyzing "matplotlib.pyplot ...
mypy matploitlib: error: Skipping analyzing "matplotlib.pyplot": module is installed, but missing library stubs or py.typed marker.
Read more >Language Processing Pipelines · spaCy Usage Documentation
spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more....
Read more >Typechecking with a Python Library That Has No Type Hints
When you see this error it's worth first checking that there aren't any types already available. Sometimes a later version of the library...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Explosion’s blog post regarding spaCy 3.0 says:
Since
Doc
is implemented in Cython, there are in fact no type hints, so @mr-bjerre , you should not be looking for VSCode issues.@svlandeg , are there any plans to annotate the Cython code with type hints? The most straight forward way would be to create a
pyi
file corresponding to every.pyx
file, and then including apy.typed
file with the wordpartial
in it (all of this is from PEP 561 ). PS: Just for completeness, apparently it’s possible forwrite Cythonized code solely using type hints. But I don’t think this approach is battle tested enough to try out in a big library likespaCy
…Hi, is there any followup on this issue ? I stumbled on the same problem and cannot get mypy typings because of the Cython classes…
Is it planned to add some pure python typings or in python/mypy to lookup for cython code ?
Thanks in advance, Have a great day !