AttributeError: module ‘cv2.cv2‘ has no attribute ‘face‘

Today, there was an error when running opencv module attributeerror: module 'CV2. CV2' has no attribute 'face' , CSDN checked and said that it was necessary to uninstall opencv first and then install it again. I felt that it was too troublesome, so I tried to find the answer in stackoverflow, which was effective. I specially recorded it

Opencv has two modules, OpenCV_ contrib_ pythonopencv_ Python let their two version numbers be the same is OK.
If not, adjust the version number of the two modules at the same time and try again. Remember to be consistent

PIP install the specified version

pip install opencv_contrib_python == version

If this helps you, please click like to support it 😀

Read More: