模块 'cv2' 没有属性 'face'

module 'cv2' has no attribute 'face'

我尝试用opencv做人脸识别。但是我面临一些属性错误。我还安装了 pip install opencv-contrib-python library 并重新安装了 python.org 软件,但仍然面临该错误

The code and output screen

我使用这个命令解决了这个问题。

pip uninstall opencv-contrib-python

pip install opencv-contrib-python==4.4.0.46