question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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).

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 image

But still fails in the end stating that no type hints or library stubs have been found: image

Your assistance is highly appreciated- thanks! 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
sobolevncommented, Oct 4, 2020

Yeap, this can be closed. Solution: use MYPYPATH env var or mypy_path option when mypy fails to detect your stubs.

0reactions
abncommented, Oct 4, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found