Package | 解决 module ‘cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipeline‘

.

problem background

Since this question appeared twice, I decided to record it. The experimental background is to use the opencv python library for data preprocessing, and the error message is as follows: "
import
cv2
File "/opt/conda/lib/python3.8/site-packages/cv2/init.py ", line 181, in bootstrap () File “/opt/conda/lib/python3.8/site-packages/cv2/ init.py ”, line 175, in bootstrap if __load_extra_py_code_for_module(“cv2”, submodule, DEBUG): File “/opt/conda/ lib/python3.8/site-packages/cv2/ init.py ”, line 28, in __load_extra_py_code_for_module py_module = importlib.import_module(module_name) File “/opt/conda/lib/python3.8/importlib/init.py ”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)







File “/opt/conda/lib/python3.8/site-packages/cv2/gapi/init.py”, line 290, in
cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline
AttributeError: partially initialized module ‘cv2’ has no attribute ‘gapi_wip_gst_GStreamerPipeline’ (most likely due to a circular import)

.

solution

Some of the search methods are not suitable. After trying a few times, this method is effective:

pip install opencv-python install "opencv-python-headless<4.3"

Refer to the original blog link: https://blog.csdn.net/qq_40761320/article/details/125687320?spm=1001.2014.3001.5501

.

Guess you like

Origin blog.csdn.net/iLOVEJohnny/article/details/126466515