cv2.error: OpenCV(4.5.5) /io/opencv/modules/highgui/src/window.cpp:1268: error:

1. 工程项目中遇到cv2.imshow('online_im', im)报以下错误:

cv2.error: OpenCV(4.5.5) /io/opencv/modules/highgui/src/window.cpp:1268: 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'

2. 解决方案

opencv-python可能版本太高,使用 pip install opencv-python==4.1.0.25 -i https://pypi.tuna.tsinghua.edu.cn/simple 降低opencv-python的版本。本人试过可行!

你可能感兴趣的:(opencv,人工智能,计算机视觉)