title: How to include libgtk2.0-dev and pkg-config in cmake when installing openCV on Ubuntu 16
body: <p>I know there are many topics on how to install OpenCV-Python. 
  I went over many of them and they helped me to go through some problems installing openCV-python on Ubuntu </p>
  
  <p>I managed to install openCV but is not properly working. When I try to run:</p>
  
  <pre><code>import numpy
  import cv2
  img= cv2.imread('image.png',0)
  cv2.imshow('image',img)
  </code></pre>
  
  <p>I get an error</p>
  
  <blockquote>
    <p>error: /io/opencv/modules/highui/src/window.cpp:583: error: (-2) The
    function is not implemented. Rebuilt 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 cvSowImage</p>
  </blockquote>
  
  <p>How do I do that? I suspect I should repeat cmake and somehow include these two libraries on it, but how?</p>
  
  <p><strong>EDIT March 19 2017</strong>
  I followed instructions from:</p>
  
  <blockquote>
    <p><a href="http://milq.github.io/install-opencv-ubuntu-debian/" rel="noreferrer">http://milq.github.io/install-opencv-ubuntu-debian/</a></p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p><a href="http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/" rel="noreferrer">http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/</a></p>
  </blockquote>
  
  <p>and from:</p>
  
  <blockquote>
    <p><a href="http://docs.opencv.org/trunk/d7/d9f/tutorial_linux_install.html" rel="noreferrer">http://docs.opencv.org/trunk/d7/d9f/tutorial_linux_install.html</a></p>
  </blockquote>
  
  <p>Everytime my script include (I am running from IDLE):</p>
  
  <p><code>cv2.imshow('image',img</code>)</p>
  
  <p>I got the same error message:</p>
  
  <pre><code>Traceback (most recent call last):
  
        File "/home/dcanals/Documents/test.py", line 5, in &lt;module&gt;
          cv2.imshow('image',img)
      error: /io/opencv/modules/highgui/src/window.cpp:583: 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
  </code></pre>
  
  <p>I rellay do not understand what is going on. I just want to have openCV to start learning this package. I have libgtk2 and pkg-config installed. I follow step by step the instructions. Why it is not working? What should I do now to get python-openCV working? Thank you</p>
  
  <p><strong>EDIT March 21 2017</strong></p>
  
  <p>I edit this post because I think I found very important documentation in:
  <a href="https://pypi.python.org/pypi/opencv-python" rel="noreferrer">https://pypi.python.org/pypi/opencv-python</a></p>
  
  <p>Where is written abouth the package 'opencv-python':</p>
  
  <p>IMPORTANT NOTE:</p>
  
  <blockquote>
    <p>MacOS and Linux wheels have some limitations:</p>
    
    <p>video related functionality is not supported (not compiled with
    FFmpeg) for example cv.imshow() will not work (not compiled with GTK+
    2.x or Carbon support)</p>
  </blockquote>
  
  <hr>
  
  <p><strong>SOLVED</strong></p>
  
  <p>I managed to make it work. </p>
  
  <p>The problem was I had a mix of packages, that probably were incompatible. 
  First time I tried to install OpenCV I used opencv-python package. It didn't work, so I tried to build the official opencv with python. Nothing worked. </p>
  
  <p>The solution was to re-install Ubuntu 16.10 and re-install opencv from the official site. </p>