而在Ubuntu 16.10與運行程序OpenCV的一個簡單的Python3我收到此錯誤工作。OpenCV的不python3
OpenCV Error: Unspecified error (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 cvShowImage, file
/io/opencv/modules/highgui/src/window.cpp, line 583 Traceback (most
recent call last): File "samplecv.py", line 3, in <module>
cv2.imshow('image',img) 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
我跑的程序是:
import cv2
img = cv2.imread('my.jpg',0)
cv2.imshow('image',img)
我已經檢查了類似的問題this和this。並重新安裝opencv,但它沒有幫助。
如果通過Python的PIP安裝OpenCV的,[這是衆所周知的是,Python包裝不與GTK支持編譯](https://stackoverflow.com/a/43531919/3250829),所以你不能表現出屏幕上的圖像以及這些錯誤。您唯一的選擇是編譯源代碼以生成正確的Python包,以便顯示圖像。這些來自PyImageSearch的方向非常好:http://pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/。根據您的系統配置和設置,準備花30分鐘到1小時。 – rayryeng
感謝它現在完成。 –