Python – OpenCV VSCode problems fix
Table of Contents
Intro
If your VSCode gives you Problems while import cv2 and can’t use autoComplete with it, here is you fix.
Instructions
Solution
- On VScode: CTRL + Shift + P
- Choose “Preferences: Open Settings (JSON)”
- Add this line into JSON file:
"python.linting.pylintArgs": ["--generate-members"]
- Done, it works for meΒ π
settings.json
"python.linting.pylintArgs": [
"--generate-members"
]

Example Code
import cv2
import numpy
img = numpy.zeros([320, 320], numpy.uint8)
cv2.imshow("test", img)
cv2.waitKey()
cv2.destroyAllWindows()