AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)

Viewed 22882

This happened out of the blue, I was able to import cv2 but now I get 'AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)' error when I import it. The things I tried:

1-uninstalling and installing opencv. 2-In cmd, I typed "pip list" and opencv-python package is listed. I ran "python" command and tried importing cv2 but I get the same error. Please help.

5 Answers

I also had the same problem with opencv-python-4.6.0.66

I solved this error by just downgrading opencv. you can follow this command.

pip install opencv-python==4.5.5.64

Hope this will help you.

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip uninstall opencv-contrib-python-headless

and then

pip3 install opencv-contrib-python==4.5.5.62

Upgrading opencv solved the issue for me: !pip install opencv-python==4.6.0.66

I changed my anaconda environment but it caused some other bugs. I just uninstall anaconda and installed it. It works now

Related