title: Python error: PyThreadState_Get: no current thread after compiling an extension
body: <p>I am testing <a href="https://github.com/Russell91/TensorBox" rel="nofollow noreferrer">TensorBox</a>, which is based on Google's Tensorflow for some task.  There is a small piece of code that needs to be compiled and I compile it.  When running <code>otool -L stitch_wrapper.so</code> this is the output:</p>
  
  <pre><code>stitch_wrapper.so (compatibility version 0.0.0, current version 0.0.0)
  libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.0)
  /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
  </code></pre>
  
  <p>Whenever I do in python <code>import stitch_wrapper</code>, I get the error:</p>
  
  <pre><code>Fatal Python error: PyThreadState_Get: no current thread
  Abort trap: 6
  </code></pre>
  
  <p>I read in a comment in <a href="https://stackoverflow.com/questions/15678153/homebrew-python-on-mac-os-x-10-8-fatal-python-error-pythreadstate-get-no-cu">this other question</a> that this happens whenever a module tries to use a python library that is different than the one the interpreter uses, that is, when you mix two different pythons.  I have two different pythons in the machine, and the one I am using when running the code is the <code>anaconda</code> python that I installed in my <code>home</code> directory.  Pardon my question if I am confused, but how can I compile properly for my <code>anaconda</code> python?  I tried importing within my other python and it works well. But I need it working for my anaconda python.</p>