-1

它给出了这个错误:

error Traceback (most recent call last) <ipython-input-6-5e400e6b9939> in <module>() 1 img = cv2.imread(imgpath) 2 ----> 3 cv2.namedWindow('Lena', cv2.WINDOW_AUTOSIZE) 4 cv2.imshow('Lena', img) 5 cv2.waitKey(0) error: /tmp/build/80754af9/opencv_1512687413662/work/modules/highgui/src/window.cpp:593: 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 cvNamedWindow

我使用 conda 安装了这个包,所以无法理解如何进行更改。

4

1 回答 1

0

似乎是你的opencv的一个问题,从错误我的假设是你从源代码构建它。
我会建议你卸载当前的 opencv 并通过 pip 安装pip install opencv-python

于 2018-02-06T06:58:00.243 回答