title: How to use opencv with python on macos
body: <p>I am porting a python+opencv app developped on windows to mac. </p>
  
  <p>On windows i have the cv2.pyd in my virtualenv site-packages and it goes well.</p>
  
  <p>I am new to mac and I don't understand hot it should work. I didn't find any binaries for opencv python bindings and it seems that the rightway is to use macport.</p>
  
  <p>macport is copying the cv.py and cv2.so in the opts/.../site-packages.</p>
  
  <p>At this point how to use it?</p>
  
  <p>I tried to copy manually these two files but I am getting an error</p>
  
  <pre><code>&gt;&gt;&gt; import cv
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv.py", line 1, in &lt;module&gt;
      from cv2.cv import *
  ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv2.so, 2): no suitable image found.  Did find:
          /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv2.so: mach-o, but wrong architecture
  </code></pre>
  
  <p>What's wrong?</p>
  
  <p>Update:
  As asked by @Vortexfive:</p>
  
  <pre><code>$ file /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv2.so
  /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv2.so: Mach-O 64-bit dynamically linked shared library x86_64
  
  $ file /Library/Frameworks/Python.framework/Versions/2.6/bin/python
  /Library/Frameworks/Python.framework/Versions/2.6/bin/python: Mach-O universal binary with 2 architectures
  /Library/Frameworks/Python.framework/Versions/2.6/bin/python (for architecture ppc):    Mach-O executable ppc
  /Library/Frameworks/Python.framework/Versions/2.6/bin/python (for architecture i386):   Mach-O executable i386
  </code></pre>
  
  <p>It seems there is a mismatch. How to fix it?</p>