title: python cannot import opencv because it can't find libjpeg.8.dylib
body: <p>Trying to get opencv for python working on Mac OSX - Mavericks but keep getting an image not found for libjpeg.8.dylib when doing import cv from python</p>
  
  <p>(Recently updated from Mountain Lion)</p>
  
  <p>This is what I did:</p>
  
  <p>1.<code>brew tap homebrew/science</code></p>
  
  <p>2.<code>brew install opencv</code></p>
  
  <p>3.<code>python</code></p>
  
  <p>4.<code>import cv</code></p>
  
  <h2>-got the following error:</h2>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/cv.py", line 1, in &lt;module&gt;
      from cv2.cv import *
  ImportError: dlopen(/usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: /usr/local/lib/libjpeg.8.dylib
    Referenced from: /usr/local/Cellar/opencv/2.4.9/lib/libopencv_highgui.2.4.dylib
    Reason: image not found
  </code></pre>
  
  <hr>
  
  <ol start="5">
  <li>I looked for libjpeg.8.dylib and found it in <code>/usr/local/Cellar/jpeg/8d/lib/</code> which, apparently, is not where libopencv_highgui.2.4.dylib is looking.</li>
  </ol>
  
  <p>I'm a bit new to Mac OS and homebrew. Could anyone explain how to resolve this error and get opencv running? I have the python that comes preinstalled with Mac and them python installed by homebrew.</p>
  
  <p>Thank you.</p>