'The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support

I am getting this error please someone help me

I am using windows 11

error                                     Traceback (most recent call last)
<ipython-input-25-c5fda75a971a> in <module>
     28                 agnostic_mode=False)
     29 
---> 30     cv2.imshow('object detection', cv2.resize(image_np_with_detections, (800, 600)))
     31 
     32     if cv2.waitKey(1) & 0xFF == ord('q'):

error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1268: 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'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source