当前位置:   article > 正文

报错解决error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1255_error: opencv(4.9.0) d:\a\opencv-python\opencv-pyt

error: opencv(4.9.0) d:\a\opencv-python\opencv-python\opencv\modules\highgui

一、报错如下

  • opencv的问题
    在这里插入图片描述
    Traceback (most recent call last): File "E:\scoder\PyCharm2023.2.1\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, local_vars) File "<input>", line 1, in <module> cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1255: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'

二、解决方式

  • 先卸载了我自带的pip uninstall opencv-python-headless
    在这里插入图片描述
  • 然后重新安装opencv-python,pip install opencv-python -i https://mirrors.aliyun.com/pypi/simple/ , 然后问题就解决了
    在这里插入图片描述
    在这里插入图片描述

三、出现这个WARNING: Ignoring invalid distribution -pencv-python-headless (e:\scoder\python3.10\lib\site-packages)

  • 问题WARNING: Ignoring invalid distribution -pencv-python-headless (e:\scoder\python3.10\lib\site-packages)
    在这里插入图片描述
  • 解决方法 到e:\scoder\python3.10\lib\site-packages 删除
    在这里插入图片描述
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/404335
推荐阅读
相关标签
  

闽ICP备14008679号