OpenCV Members are not recognized #10027
Labels
Lib specific 💅
This affect the code from a particular library
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
Bug description
when working with cv2 and saving files, PyLint does complain it cannot find the cv2 members, hence, flooding the Problems tab with messages, which are in fact no problem at all. Below is a MWE to reproduce some of the messages.
Configuration
No response
Command used
VSCode PyLint Extension
pylint --reports=n --output-format=json --clear-cache-post-run=y --from-stdin opencv_mwe_pylint_err.py
Pylint output
[
{
"type": "error",
"module": "object_tracker.opencv_mwe_pylint_err",
"obj": "",
"line": 5,
"column": 6,
"endLine": 5,
"endColumn": 22,
"path": "poc\object_tracker\opencv_mwe_pylint_err.py",
"symbol": "no-member",
"message": "Module 'cv2' has no 'VideoCapture' member",
"message-id": "E1101"
},
{
"type": "error",
"module": "object_tracker.opencv_mwe_pylint_err",
"obj": "",
"line": 6,
"column": 25,
"endLine": 6,
"endColumn": 59,
"path": "poc\object_tracker\opencv_mwe_pylint_err.py",
"symbol": "no-member",
"message": "Module 'cv2' has no 'createBackgroundSubtractorMOG2' member",
"message-id": "E1101"
},
{
"type": "error",
"module": "object_tracker.opencv_mwe_pylint_err",
"obj": "",
"line": 11,
"column": 22,
"endLine": 11,
"endColumn": 38,
"path": "poc\object_tracker\opencv_mwe_pylint_err.py",
"symbol": "no-member",
"message": "Module 'cv2' has no 'findContours' member",
"message-id": "E1101"
},
{
"type": "error",
"module": "object_tracker.opencv_mwe_pylint_err",
"obj": "",
"line": 12,
"column": 21,
"endLine": 12,
"endColumn": 38,
"path": "poc\object_tracker\opencv_mwe_pylint_err.py",
"symbol": "no-member",
"message": "Module 'cv2' has no 'RETR_EXTERNAL' member",
"message-id": "E1101"
},
{
"type": "error",
"module": "object_tracker.opencv_mwe_pylint_err",
"obj": "",
"line": 12,
"column": 40,
"endLine": 12,
"endColumn": 63,
"path": "poc\object_tracker\opencv_mwe_pylint_err.py",
"symbol": "no-member",
"message": "Module 'cv2' has no 'CHAIN_APPROX_SIMPLE' member",
"message-id": "E1101"
},
{
"type": "error",
"module": "object_tracker.opencv_mwe_pylint_err",
"obj": "",
"line": 15,
"column": 0,
"endLine": 15,
"endColumn": 21,
"path": "poc\object_tracker\opencv_mwe_pylint_err.py",
"symbol": "no-member",
"message": "Module 'cv2' has no 'destroyAllWindows' member",
"message-id": "E1101"
}
]
Expected behavior
PyLint should recognize all members in the cv2 module.
Pylint version
pylint 3.2.7
astroid 3.2.4
Python 3.12.7
OS / Environment
Windows 11
Ubuntu 24.04
Raspberry Pi OS with desktop
Release date: July 4th 2024
System: 32-bit
Kernel version: 6.6
Debian version: 12 (bookworm)
Additional dependencies
opencv-python==4.10.0.84
The text was updated successfully, but these errors were encountered: