-
Notifications
You must be signed in to change notification settings - Fork 853
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
Module "cv2" does not explicitly export attribute "typing" #901
Comments
Thanks a lot for the issue report. Most probably the issue has been resolved in OpenCV 4.x branch and the fix will be released in 4.9.0. Could you try current 4.x branch? |
@asmorkalov Gladly! How do I do that properly? Do I just build a wheel from this repository or is this a more involved process? |
I've taken a wheel out of https://github.com/opencv/opencv-python/actions/runs/6221534986 ( |
Or maybe that's the wrong branch, let me check... |
Same result with |
This is a static type-checking error saying that the module Big edit: scrap that. It's a mypy issue. it gets confused between the cv2 module importing pyright handles it correctly. import cv2
import cv2.typing
_ = cv2.typing.MatLike # Module "cv2" does not explicitly export attribute "typing" Mypy([attr-defined](https://mypy.readthedocs.io/en/latest/_refs.html#code-attr-defined)) Edit 2: Created issue: python/mypy#16216 |
Thanks, guys! Will try to test it this week! |
@asmorkalov @VadimLevin @Avasam I have built the wheels and can confirm it's working as expected! Thank you very much! |
Expected behaviour
Type hints (e.g. with
mypy
) work properly oncv2.imdecode
Actual behaviour
cv2.imdecode
return values resolve toAny
.Steps to reproduce
opencv-python-headless
4.8.0.76 andmypy
1.5.1main.py
with the following code:mypy
onmain.py
It seems like the original override definition
can't resolve
cv2.typing.MatLike
and replaces it byAny
. The reason seems to be the error messageModule "cv2" does not explicitly export attribute "typing"
.Issue submission checklist
opencv-python
The text was updated successfully, but these errors were encountered: