skip to Main Content

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


  1. This error happen because of conda. Follow the commands below and should solve your problem:

    conda remove opencv
    conda install -c menpo opencv
    pip install --upgrade pip
    pip install opencv-contrib-python
    

    There are also other possible solutions here

    Login or Signup to reply.
  2. It back to normal after I try to reinstall the opencv

    pip install --upgrade opencv-python
    
    Login or Signup to reply.
  3. I had the same issue. Solved it by doing the following:

    pip uninstall opencv-python
    pip install opencv-python
    
    Login or Signup to reply.
  4. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search