mypy says "no type hints or library stubs" although it parses package's .pyi
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: win10
- Poetry version: 1.0.5
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/yanoom/b0a757aa512e6cb0a122ca3cfbc7f416
Issue
We are in the process of releasing our library, called “Pyctuator”.
I successfully created stubs for the package using stubgen.
I added the MYPYPATH
environment variable with the location of the previously created “stub output folder” for mypy to find the stubs.
I use poetry run mypy
on an example application that uses our new package:
I see that mypy is parsing the desired pyctuator.pyi
But still fails in the end stating that no type hints or library stubs have been found:
Your assistance is highly appreciated- thanks! 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Running mypy and managing imports
If you are getting a Cannot find implementation or library stub for module error, this means mypy was not able to find the...
Read more >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 >python/typing - Gitter
According to PEP 561, the presence of a py.typed file means that the package supports typing. The PEP says, "If a top-level package...
Read more >Mypy Documentation - Read the Docs
Mypy is a static type checker for Python. Type checkers help ensure that you're using variables and functions in your code correctly.
Read more >Typechecking with a Python Library That Has No Type Hints
However sometimes you get the message found module but no type hints or library stubs , because that library doesn't have any type ......
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 Free
Top 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
Yeap, this can be closed. Solution: use
MYPYPATH
env var ormypy_path
option whenmypy
fails to detect your stubs.@sobolevn so I can close this issue then? Assuming there is nothing to be done on the poetry side since we are following standard mechanisms to load path into python site.