-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Mypy cannot find library stubs for protobuf #10986
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
Comments
+1 It seems like only cc @Avasam might be as easy as adding |
And mypy is (should be) able to resolve typed namespaced packages correctly (it's a core part of the spec). I also cannot replicate op's situation locally (pretty sure their issue is caused by the |
hm I'm not sure about OP's situation, but I'm encountering this issue:
This shows an error at "Could not find library |
I can reproduce the issue locally, but I don't see anything wrong with the installed |
Anyway, I'm closing this issue, because the original issue seems to be unrelated to the problem by @brandonchinn178 and looks to be a weird problem related to the environment of the submitter. @brandonchinn178: Could you open an issue against mypy, with your problem description? |
I'm having issues with mypy correctly finding type stubs.
After creating a virtual environment on my Fedora machine using
virtualenv
, I install the following packages:Using mypy to check the following code
I get the error messsage:
The reason for this seems that in the virtual environment there are two independent lib directories (
my_env/lib
andmy_env/lib64
). Onegoogle
directory containing code of the protobuf package is inlib64/google
and the types (types-protobuf
) are installed tolib/google-stubs
.Either moving the
google-stubs
directory to thelib64
variant or creating an (empty)google
directory inlib
resolves the issue.It seems mypy is unable to find the corresponding type stubs in the respectively other lib directory.
Has anybody an idea on how to approach this? I do not even know whether the respective installation locations of either the protobuf or the types-protobuf package are correct or whether this is an issue with mypy resolving types?!
The text was updated successfully, but these errors were encountered: