如何处理Windows中的The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support.问题
问题描述
opencv运行出现的问题代码提示:
D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1274: error: (-2:Unspecified e
rror) 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 'cvShowImage'
windows解决方案:
先用pip打开包列表;
cmd打开命令行,输入pip list
找到opencv的几个对应的包:

解决方案
发现opencv-python-headless的版本和上面两个不一样,利用pipi的卸载和安装命令将其安装成上面两个一样的版本;
在安装之前,可以先将pip默认的下载镜像源设置:
可以利用这一行代码进行设置
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
#设置成清华源
pip install opencv-contrib-python
#安装opencv的包
然后可以再利用pip list命令查看opencv相关的包是否都版本一致,然后用下列方法进行安装和卸载;


再到编辑器里面运行即可

发现不报错,说明可以正常运行了,希望对大家前期学习和安装opencv有帮助。
参考了一下博主的文章,后面根据自己的尝试解决,大家也要多思考捏!
[1]: https://blog.csdn.net/qq_46018888/article/details/121430749

887

被折叠的 条评论
为什么被折叠?



