Python OpenCV imshow() 函数未实现

Python OpenCV imshow() function is not implemented

我在Python开始使用opencv。但我对此有一些疑问。 这是我的代码:

image = None
image = cv2.imread('7.jpg')
if image != None:
    print("len >    " + str(len(image)))
    # show image
    cv2.imshow('image', image)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
else:
    print("Image is None")

当我 运行 这个简单的代码时我有这个错误:

OpenCV Error: Unspecified error (The function is not implemented.

If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

我检查过了,但是所有的包都安装了。我删除它们并重试安装。但那没有用! 我该怎么办...

这个我真的查过了Link

但是当我尝试这个命令时:cmake -D WITH_QT=ON .. 我在终端中有这个:

The source directory "/home" does not appear to contain CMakeLists.txt

我该怎么办?

似乎 opencv 在 python 3 及更高版本上有问题。我在 python 2.7 中尝试了这段代码并且有效