conda环境opencv报错cv2.error:

阅读 56

2022-03-25

conda环境中使用opencv时,可能会报以下错误:

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'

折腾了大半天,终于从stack overflow中找到了解决办法,超级简单,记录一下

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

pip install opencv-python

然后安装pencv-contrib-python

pip install opencv-contrib-python 

精彩评论(0)

0 0 举报