python duke.py
Traceback (most recent call last): File “duke.py”, line 5, in
cv2.imshow(‘ktm’,img)
cv2.error: OpenCV(3.4.2)
/opt/conda/conda-bld/opencv-suite_1535678557175/work/modules/highgui/src/window.cpp:632:
error: (-2: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 function ‘cvShowImage’
here is my code
import cv2
img = cv2.imread('Downloads/404615.jpg',1)
while True:
cv2.imshow('ktm',img)
if cv2.waitkey(1) & 0*FF == 27:
break
cv2.destroyAllWindows()
4
Answers
This error happen because of conda. Follow the commands below and should solve your problem:
There are also other possible solutions here
It back to normal after I try to reinstall the opencv
I had the same issue. Solved it by doing the following:
uninstalling and reinstalling opencv seems to work for some people. Though, if you want to understand want happened, the answer is here;
https://stackoverflow.com/a/68975495/4838973