AttributeError: module ‘cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipeline‘

created at 06-20-2022 views: 71

problem

During face recognition learning, the following error was reported:

AttributeError: module 'cv2' has no attribute 'face'

After google, I found that the face function is not included in the opencv library and needs to be downloaded

pip install opencv-contrib-python

Then reported this error again

AttributeError: module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline'

two solutions

  1. Uninstall opencv and contrib and reinstall it, it is invalid after practice.
  2. Keep only one of the two, I keep the latter, no more errors are reported, and the code runs normally.
created at:06-20-2022
edited at: 06-20-2022: