cv2.imshow("Result", img)错误/error

Traceback (most recent call last):
File “E:\pythonProject\lianxi\图片匹配\”, line 16, in
cv2.imshow(“Result”, img)
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1272: 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 ‘cvShowImage’

■opencv_ contrib. python-
contrib_ python headless-
■opencv_ python-
■opencv_ python. headless-

My system is a window system. It uses pycharm. The python version is 3.9.4, and the opencv version number is

■opencv_ contrib. _ python-

■opencv_ contrib_ python headless-

■opencv_ python-

■opencv_ python. headless-

I want to know what is the solution to this error and where is the problem. I’m a little dizzy. :cry:

you’ve installed far too many (4 !) opencv versions on the same machine. uninstall them all, then pick exactly one
(probably : pip install opencv_contrib_python )

((also, just saying: the ‘headless’ versions are for e.g. webservers, no gui there !))

1 Like

谢谢你的方法,解决了我的问题,非常感谢 :pray:
Thank you for your method and solving my problem. Thank you very much

1 Like