报错集合
package
import cv2
# 读取图像文件
image = cv2.imread(r'C:\Users\22924\Desktop\1.png')
cv2.imshow('Image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
报错如下:
OpenCV(4.6.0) C:\b\abs_f8n1j3l9l0\croot\opencv-suite_1691622637237\work\modules\highgui\src\window.cpp:1267: error: (-2 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'
解决方案
pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple

浙公网安备 33010602011771号