具体报错:cv2.error: OpenCV(4.11.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1301: 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-python和opencv-contrib-python重新安装,但是我重新安装之后这个1301的报错仍然存在,偶然发现执行pip uninstall opencv-python-headless
把这个依赖库删掉之后报错解决了,程序可以顺利运行
但是有个疑问在执行pip uninstall opencv-python-headless之后我执行过conda list没有发现有opencv-python-headless这个库
但是确实是能删掉。。。
希望有大佬能解决我的疑问