Ask Your Question
0

cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:627: error: (-2:Unspecified error) The function is not implemented

asked 2019-06-25 03:02:49 -0500

updated 2019-06-25 03:17:31 -0500

LBerger gravatar image

(While running this code I am getting this error , I am using windows10 Pro 6bit OS)

import numpy as np
import cv2

img = cv2.imread('messi5.jpg',0)
cv2.imshow('image',img)
k = cv2.waitKey(0)
if k == 27:         # wait for ESC key to exit
    cv2.destroyAllWindows()
elif k == ord('s'): # wait for 's' key to save and exit
    cv2.imwrite('messigray.png',img)
    cv2.destroyAllWindows()

Traceback (most recent call last): File "C:\Users\DEBASISH\AppData\Local\Programs\Python\Python36\Projects\read_image.py", line 5, in <module> cv2.imshow('image',img) cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:627: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa 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'

(While running this code I am getting this error , I am using windows10 Pro 6bit OS)

edit retag flag offensive close merge delete

Comments

what did you install there, and from where ?

this problem should not exist on windows.

berak gravatar imageberak ( 2019-06-25 06:20:37 -0500 )edit

yes right but for the first time i faced such issues, in my earlier installation in office Desktop, i had not faced such issues this issue i faced while installing in my laptop. and issue was resolved just by re-installing opencv-python using pip command

debcdac gravatar imagedebcdac ( 2019-06-28 12:59:42 -0500 )edit

same problem on Ubuntu 18 , wtf. That worked though. Only took me 2 days, like 12 hours.

yukon456 gravatar imageyukon456 ( 2019-07-11 20:54:59 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
-1

answered 2019-06-28 13:01:45 -0500

This issue can be resolved by re-installing opencv-python by running from command prompt

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-06-25 03:02:49 -0500

Seen: 549 times

Last updated: Jun 28