I was trying an OpenCV tutorial and when I run the python code I got this error
OpenCV Error: 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 cvShowImage, file /home/pankaja/Desktop/OpenCV-tmp/opencv/modules/highgui/src/window.cpp, line 611
Traceback (most recent call last):
File "/home/pankaja/PycharmProjects/ImageProcessing/imageprocess.py", line 8, in <module>
cv2.imshow('image', img)
cv2.error: /home/pankaja/Desktop/OpenCV-tmp/opencv/modules/highgui/src/window.cpp:611: 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 cvShowImage
So as for OpenCV error: the function is not implemented this stackoverflow answer I tried the command sudo apt-get install libopencv-* and got this,
*The following packages have unmet dependencies:
libopencv-apps-dev : Depends: libcv-bridge-dev but it is not going to be installed
Depends: libdynamic-reconfigure-config-init-mutex-dev but it is not going to be installed
Depends: libimage-transport-dev but it is not going to be installed
Depends: libnodeletlib-dev but it is not going to be installed
Depends: libroscpp-dev but it is not going to be installed
libopencv-highgui-dev : Depends: libgtk2.0-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.*
How to solve this? What have I done wrong ?
Edit 1 : after I run sudo apt-get install -f as @Jeru Luke mentioned
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libenca0 librubberband2v5 libva-wayland1 linux-headers-4.10.0-27 linux-headers-4.10.0-27-generic linux-headers-4.10.0-30
linux-headers-4.10.0-30-generic linux-headers-4.4.0-89 linux-headers-4.4.0-89-generic linux-headers-4.4.0-92 linux-headers-4.4.0-92-generic
linux-image-4.10.0-27-generic linux-image-4.10.0-30-generic linux-image-4.4.0-89-generic linux-image-4.4.0-92-generic
linux-image-extra-4.10.0-27-generic linux-image-extra-4.10.0-30-generic linux-image-extra-4.4.0-89-generic
linux-image-extra-4.4.0-92-generic linux-signed-image-4.10.0-27-generic linux-signed-image-4.10.0-30-generic mpv rtmpdump
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
still getting the error when I run sudo apt-get install libopencv-*
Edit 2 : After run the sudo apt-get install libgtk-3-dev command as @Zindarod mentioned
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libgtk-3-dev : Depends: libgtk-3-0 (= 3.18.9-1ubuntu3) but 3.18.9-1ubuntu3.3 is to be installed
Depends: gir1.2-gtk-3.0 (= 3.18.9-1ubuntu3) but 3.18.9-1ubuntu3.3 is to be installed
Depends: libatk-bridge2.0-dev but it is not going to be installed
Depends: libepoxy-dev (>= 1.0) but it is not going to be installed
Depends: libegl1-mesa-dev but it is not going to be installed
Depends: libwayland-dev (>= 1.5.91) but it is not going to be installed
Depends: libmirclient-dev (>= 0.13.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
still no luck