AttributeError: partially initialized module 'cv2' has no attribute

问题描述 投票:0回答:0

如何解决这个错误

Traceback (most recent call last):
  File "C:\Users\shash\Desktop\Python_TTH\main (3).py", line 1, in <module>
    import cv2
  File "C:\Users\shash\AppData\Roaming\Python\Python310\site-packages\cv2\__init__.py", line 181, in <module>
    bootstrap()
  File "C:\Users\shash\AppData\Roaming\Python\Python310\site-packages\cv2\__init__.py", line 175, in bootstrap
    if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
  File "C:\Users\shash\AppData\Roaming\Python\Python310\site-packages\cv2\__init__.py", line 28, in __load_extra_py_code_for_module
    py_module = importlib.import_module(module_name)
  File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\shash\AppData\Roaming\Python\Python310\site-packages\cv2\gapi\__init__.py", line 301, in <module>
    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)
opencv attributeerror cv2
© www.soinside.com 2019 - 2024. All rights reserved.