conda 环境 cv2.imshow报错

报错如下:

cv2.error: OpenCV(4.4.0) /tmp/pip-req-build-dglzv4yn/opencv/modules/highgui/src/window.cpp:651: 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'

谷歌搜索出解决方案:

首先conda环境中使用pip安装opencv-python:

pip install opencv-python

然后安装pencv-contrib-python:

pip install pencv-contrib-python

bingo!!!

你可能感兴趣的:(OPencv)