如何修复“ ImportError:错误:在加载“ cv2”二进制扩展名时检测到递归。请检查OpenCV安装。”

时间:2019-08-06 19:44:35

标签: python python-3.x opencv python-3.7

我已经执行以下操作:

  • pip install numpy
  • pip安装matplotlib
  • pip install cv2
  • python -m pip安装opencv-contrib-python

我将cv2文件夹放入了Python73-32\Lib。从here安装cv2并将其从opencv\build\python中取出时,cv2文件夹来自。这是我得到的错误:

    Traceback (most recent call last):
  File "C:\Users\oskil\OneDrive\Pulpit\TestPress.py", line 6, in <module>
    import cv2
  File "C:\Users\oskil\AppData\Local\Programs\Python\Python37-32\lib\cv2\__init__.py", line 89, in <module>
    bootstrap()
  File "C:\Users\oskil\AppData\Local\Programs\Python\Python37-32\lib\cv2\__init__.py", line 23, in bootstrap
    raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.

我该如何进行呢?

1 个答案:

答案 0 :(得分:0)

重新安装Windows修复了问题,让我使用pip install opencv-python