AttributeError: module ‘cv2‘ has no attribute ‘drawFacemarks‘和no attribute ‘face‘

看网上很多解决方法都是说是opencv-contrib-python的原因,但是我一开始重装和安装都不行,之后看到一个是说opencv版本过低的原因

报错1:

 代码:

AttributeError: module ‘cv2‘ has no attribute ‘drawFacemarks‘和no attribute ‘face‘_第1张图片

 更新到opencv最新版本

pip install opencv-python -i http://mirrors.aliyun.com/pypi/simple/   --trusted-host mirrors.aliyun.com
pip install opencv-contrib-python -i http://mirrors.aliyun.com/pypi/simple/   --trusted-host mirrors.aliyun.com

再次运行:

报错2

 参考了这个博主的方法,也还是没有解决  一直说 no  attribute 'face'https://blog.csdn.net/weixin_62075168/article/details/127767849?ops_request_misc=&request_id=&biz_id=102&utm_term=no%20attribute%20%27face%27&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-127767849.142^v87^control_2,239^v2^insert_chatgpt&spm=1018.2226.3001.4449

pip list之后,感觉有的包没什么网上提到的毛病啊

AttributeError: module ‘cv2‘ has no attribute ‘drawFacemarks‘和no attribute ‘face‘_第2张图片

最后看到这个哥们的方法

解决 ‘cv2’ has no attribute ‘face’ 的问题

pip uninstall opencv-python
pip install opencv-contrib-python

删除了opencv-python

解决!!

你可能感兴趣的:(java,开发语言,计算机视觉,opencv)