import cv2
img = cv2.imread('mikrotik.jpg',0)
cv2.imshow('image',img)
cv2.waitKey(0)cv2.destroyAllWindows()
然后得到此错误
>/Users/briant/venv/bin/python /Users/briant/PycharmProjects/InputandOutput/ImageTestFile.py
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 /Users/travis/build/skvark/opencv->python/opencv/modules/highgui/src/window.cpp, line 583
>Traceback (most recent call last):
> File "/Users/briant/PycharmProjects/InputandOutput/ImageTestFile.py", >line 9, in <module>
> cv2.imshow('image',img)
>cv2.error: /Users/travis/build/skvark/opencv->python/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
>Process finished with exit code 1
有人可以向我解释一下,我该怎么办? 提前谢谢你。