Opencv-python: error: recursion is detected during loading of "cv2" binary extensions

Created on 29 Dec 2018  路  3Comments  路  Source: opencv/opencv-python

os: Windows 7
Python version: 3.6
opencv-contrib-Python version: 3.4.5.20

After I install the library using pip install opencv-contrib-Python, I try import cv2 and it gave the error:

recursion is detected during loading of "cv2" binary extensions.

However if I execute pip install opencv-Python followed by pip install opencv-contrib-Python, there is no error.
But according to the doc, I think I only need to executepip install opencv-contrib-Python, isn't it?

Most helpful comment

The error is a known bug in OpenCV if you compiled and installed it manually: https://github.com/opencv/opencv/issues/13202

All 3 comments

Yes, only thing you need to do is run pip install opencv-contrib-python. I tested the command and the import worked on Windows 10. I have no reason to believe that it wouldn't work on Windows 7.

The error suggests that you have some broken OpenCV installation somewhere. Have you tried to install OpenCV manually? Please remove all OpenCV installations and do a fresh install preferably to a clean virtual environment.

The error is a known bug in OpenCV if you compiled and installed it manually: https://github.com/opencv/opencv/issues/13202

Yes, I had built opencv manually, maybe this messed my python environment(anaconda) up. I have reinstalled anaconda and the problem is fixed. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Domibor picture Domibor  路  4Comments

glitchassassin picture glitchassassin  路  7Comments

moneer88 picture moneer88  路  6Comments

danielgordon10 picture danielgordon10  路  7Comments

ES-Alexander picture ES-Alexander  路  5Comments