python cv2:函数未实现.使用 Windows、GTK+ 2.x 或 Carbon 支持重建库



当我运行代码时,出现此错误:"

cv2.imshow("Original",I)
cv2.error: /io/opencv/modules/highgui/src/window.cpp:583: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon 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 

我搜索了很多信息,但我仍然不知道如何解决这个问题。有谁知道如何详细解决?我的系统是Ubuntu和python3.5。 CV2 可以在 Python 中导入。 谢谢你的帮助。

在 ubuntu 中,opencv 可以通过以下方式安装

须藤APT更新

sudo apt install python3-opencv

通过以下方式确认安装

python3 -c "import cv2; print(cv2.版本(">

在我看来,这听起来像是你没有正确构建你的opencv库。您能简要总结一下您是如何安装构建它的吗?您是git克隆,cmake并从源代码中制作项目,还是只是apt-get安装它?

If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config,

在重建之前,请确保 sudo apt-get 安装这两个库。

最新更新