在安装了python、naconda 、jupyter notebook下安装了opencv在尝试导入opencv时报错(循环嵌套)
在jupyter notebook中输入import cv2
运行结果及报错内容
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_14292\4235477061.py in <module>
----> 1 import cv2
~\AppData\Roaming\Python\Python39\site-packages\cv2\__init__.py in <module>
179
180
--> 181 bootstrap()
~\AppData\Roaming\Python\Python39\site-packages\cv2\__init__.py in bootstrap()
173
174 for submodule in __collect_extra_submodules(DEBUG):
--> 175 if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
176 if DEBUG: print("Extra Python code for", submodule, "is loaded")
177
~\AppData\Roaming\Python\Python39\site-packages\cv2\__init__.py in __load_extra_py_code_for_module(base, name, enable_debug_print)
26 native_module = sys.modules.pop(module_name, None)
27 try:
---> 28 py_module = importlib.import_module(module_name)
29 except ImportError as err:
30 if enable_debug_print:
D:\anaconda3\lib\importlib\__init__.py in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
128
129
~\AppData\Roaming\Python\Python39\site-packages\cv2\gapi\__init__.py in <module>
288
289
--> 290 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字样的文件删除,并在anaconda中下载opencv,也试过在清华镜像中下载过openv的whl并用pip install方式下载,也试过直接用pip install opencv-python,也试过pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
但最后import cv2都会爆同样的错误
想达到的成效是输入import cv2不会报错
谢谢