You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pylint test.py --extension-pkg-whitelist=cv2
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 5.00/10, +5.00)
With opencv-python-4.5.4.58:
$ pylint test.py --extension-pkg-whitelist=cv2
************* Module test
test.py:2:0: E0611: No name 'getStructuringElement' in module 'cv2' (no-name-in-module)
test.py:2:0: E0611: No name 'MORPH_ELLIPSE' in module 'cv2' (no-name-in-module)
----------------------------------------------------------------------
Your code has been rated at -40.00/10 (previous run: 10.00/10, -50.00)
Issue submission checklist
This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
I get the Module 'cv2' has no '*' member-pylint-error with
❌ python3-opencv (4.6.0 installed with apt)
❌ opencv-python (4.6.0 installed with pip)
❌ self-built OpenCV (using GitHub repos opencv/opencv and opencv/opencv_contribbut not using opencv-python).
✔️ The only way I found to make pylint work was to install version 4.5.5 of opencv-python with pip.
However, I'm required to build OpenCV from source for technical reasons.
What's the charm that lets the 4.5.5 pip wheel work with pylint and how can I apply it to my self-built OpenCV?
Build and test environment is a debian bookworm Docker container.
Activity
alalek commentedon Oct 21, 2021
BTW, does it work with
--unsafe-load-any-extension=y: https://pylint.pycqa.org/en/latest/technical_reference/c_extensions.htmlrobertschweizer commentedon Oct 21, 2021
Good idea, maybe the C extension name just changed. But no, with
--unsafe-load-any-extension=yit also does not work.jaime-dangelmeier commentedon Oct 26, 2021
I also tried using the
generated-members = cv2.*flag forpylint=> still the same issue.asmorkalov commentedon Nov 22, 2021
Since 4.5.4.60 pylint works with OpenCV python loader correctly. Command line example:
robertschweizer commentedon Jun 10, 2022
The fix for this was reverted in 5633cf3, so this bug appears again in version 4.6.0.66. Should we rename and reopen this issue or create a new one?
pasbi commentedon Aug 10, 2022
I get the
Module 'cv2' has no '*' member-pylint-error withpython3-opencv(4.6.0 installed withapt)opencv-python(4.6.0 installed withpip)opencv/opencvandopencv/opencv_contribbut not usingopencv-python).pylintwork was to install version 4.5.5 ofopencv-pythonwith pip.However, I'm required to build OpenCV from source for technical reasons.
What's the charm that lets the 4.5.5 pip wheel work with pylint and how can I apply it to my self-built OpenCV?
Build and test environment is a debian bookworm Docker container.