title: Python Import error Opencv NameError: name highgui is not defined
body: <p>Python 2.7.5</p>
  
  <p>I added the homebrew/science to my brew taps.</p>
  
  <p>I ran</p>
  
  <pre><code>brew install opencv.
  </code></pre>
  
  <p>bash profile I added</p>
  
  <pre><code>export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
  </code></pre>
  
  <p>I've opened the headgazer folder and run</p>
  
  <pre><code>python tracker.py
  
  
  Traceback (most recent call last):
    File "tracker.py", line 21, in &lt;module&gt;
      from roi_detector import ViolaJonesRoi
    File "/Users/username/Downloads/headtracker_version_0.0/roi_detector.py", line 21, in &lt;module&gt;
      import opencv as cv
  ImportError: No module named opencv
  ~/Downloads/headtracker_version_0.0:.
  </code></pre>
  
  <p>Ok, looks like it's called opencv2. So I swap out occurances of import opencv as cv with</p>
  
  <pre><code>import cv2 as cv
  </code></pre>
  
  <p>now in viola_jones_opencv.py I have</p>
  
  <pre><code>import cv2 as cv
  from cv import *
  from cv.highgui import *
  </code></pre>
  
  <p>And I get an error on importing highgui</p>
  
  <pre><code>ImportError: No module named highgui
  </code></pre>