AttributeError: module 'cv2' has no attribute 'resizedWindow'
时间: 2023-08-21 22:17:51 浏览: 103
求解报错:AttributeError:module ‘os’ has no attribute ‘exit’
这个错误是由于在使用cv2库时,调用了一个不存在的函数resizedWindow导致的。根据引用\[1\]中的错误信息,可以看出可能是由于安装的opencv库版本不兼容或者缺少某些功能导致的。为了解决这个问题,可以按照引用\[2\]中的步骤进行操作。首先,尝试卸载已安装的opencv-contrib-python和opencv-python库,可以使用以下命令:
pip uninstall opencv-contrib-python
pip uninstall opencv-python
然后,重新安装opencv-python和opencv-contrib-python库,可以使用以下命令:
pip install opencv-python
pip install opencv-contrib-python
这样可以确保安装的是最新版本的库,并且包含了所有的功能。如果问题仍然存在,可以参考引用\[3\]中的方法,检查是否安装了正确的库,并且按照正确的顺序进行安装。这样应该能够解决AttributeError: module 'cv2' has no attribute 'resizedWindow'的问题。
#### 引用[.reference_title]
- *1* [AttributeError: module ‘cv2‘ has no attribute](https://blog.csdn.net/qq_41542989/article/details/115000703)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [AttributeError: module ‘cv2‘ has no attribute ‘face‘的解决](https://blog.csdn.net/am_student/article/details/122494645)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [AttributeError: module ‘cv2‘ has no attribute ‘imread‘问题的解决方法](https://blog.csdn.net/weixin_48954645/article/details/121185323)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文