PyLint not recognizing cv2 members

后端 未结 6 877
忘掉有多难
忘掉有多难 2020-12-01 03:15

I am running pylint on an opencv project and I am getting many pylint errors in VS code about members not being present.

Example code:

import cv2
cv         


        
6条回答
  •  日久生厌
    2020-12-01 04:01

    I used below config settings in settings.json of vscode and it helped me avoid the unessential flags by pylint, and also got intellisense for cv2 working, it it doesn't work try uninstalling and deleting cv2 packages from C:\Anaconda3\envs\demo1\Lib\site-packages folder, and reinstalling opencv-python package

    {
    "python.linting.pylintEnabled": true,
      "python.linting.enabled": true,
      "python.linting.pylintArgs": [
        "--extension-pkg-whitelist=cv2"
      ]
    }
    

提交回复
热议问题