Short note on how to remove the error messages like
Module 'cv2' has no '...' member on VS Code.
In VS Code, open the setting.json file by pressing
ctrl+shift+p to open the Command Palette and type “settings” in the text field. You should see “Preferences: Open Settings (JSON)”.
settings.json and add:
With the libraries you’re using.
You can also use this argument when running pylint in the console:
pylint myscript.py --generated-members=numpy.*
Or creating a pylintrc file:
pylint --generate-rcfile > .pylintrc
And then modifying the appropriate line:
# List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E1101 when accessed. Python regular # expressions are accepted. generated-members=cv2.*
You can read the official documentation about this feature there.