title: ImportError: dlopen(/usr/local/opt/opencv3/lib/python2.7/site-packages/cv2.so, 2): Symbol not found: _PyCObject_Type
body: <p>This is how I installed opencv3 on my machine.
  I had python 3.6 installed in my system. I ran,</p>
  
  <pre><code>$ brew install opencv3 --with-contrib --with-python3 --HEAD
  </code></pre>
  
  <p>Then changed the name of opencv3 package in the 3.6 site package.</p>
  
  <pre><code>$ cd /usr/local/opt/opencv3/lib/python3.6/site-packages/
  $ mv cv2.cpython-35m-darwin.so cv2.so
  </code></pre>
  
  <p>And then created .pth file.</p>
  
  <pre><code>$ echo /usr/local/opt/opencv3/lib/python3.6/site-packages &gt;&gt; /usr/local/lib/python3.6/site-packages/opencv3.pth
  </code></pre>
  
  <p>Now when I get on the python 3 REPL and call </p>
  
  <pre><code>import cv2
  </code></pre>
  
  <p>This is the error that I get.</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: dlopen(/usr/local/opt/opencv3/lib/python2.7/site-packages/cv2.so, 2): Symbol not found: _PyCObject_Type
    Referenced from: /usr/local/opt/opencv3/lib/python2.7/site-packages/cv2.so
    Expected in: flat namespace
   in /usr/local/opt/opencv3/lib/python2.7/site-packages/cv2.so
  </code></pre>
  
  <p>I want my python 3 interpreter to look into the python 3.6 site packages for cv2 and I can't get it to do that. Any help appreciated.</p>