0
点赞
收藏
分享

微信扫一扫

cv2.imshow error: The function is not implemented. Rebuild the library with Windows...

在python中调用cv2.imshow,出现这个一个报错:

cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\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'

解决办法:安装 opencv-contrib-python

pip install opencv-contrib-python

Collecting opencv-contrib-python
  Downloading opencv_contrib_python-4.6.0.66-cp36-abi3-win_amd64.whl (42.5 MB)
     |████████████████████████████████| 42.5 MB 234 kB/s
Requirement already satisfied: numpy>=1.17.3 in e:\anaconda3\envs\torch\lib\site-packages (from opencv-contrib-python) (1.21.5)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-4.6.0.66

PS: 看源码,imshow正常来讲是在highgui中的,不会依赖contrib。不清楚是否是最新的库中调用了新的函数。


举报

相关推荐

0 条评论