Python 3.4.5中的libgtk2.0-dev和pkg-config错误

时间:2016-09-15 12:50:31

标签: python python-3.x opencv ubuntu-12.04

我刚刚在Ubuntu 12.04下安装了Python v3.4.5。从openCV-python库中尝试以下代码时

 import cv2

 img = cv2.imread('img.png',0)
 cv2.imshow('image',img)

我收到了这个错误:

 /usr/local/bin/python3.4 /home/yas/PycharmProjects/HelloWorld/HelloWorld.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 /io/opencv/modules/highgui/src/window.cpp, line 545
 Traceback (most recent call last):

我尝试过在网上推荐的一些解决方案,但问题仍然没有解决。如何在您看来克服这个问题?

0 个答案:

没有答案