title: Fatal Python error: Can't initialize threads for interpreter when calling python from c
body: <p>I tried to call python code from c, the example runs ok for sample code on my environment（python3.6）, but when I integrate it into my program, I got following error when I call <code>Py_Initialize();</code>:</p>
  
  <pre><code>...
  sem_init: Success
  Fatal Python error: Can't initialize threads for interpreter
  </code></pre>
  
  <p>Could you provide some clues to solve this problem?</p>
  
  <p>It seems the error comes from <a href="https://github.com/python/cpython/blob/3.6/Python/pystate.c#L86" rel="nofollow noreferrer">here</a>, but I am still  not sure how to avoid this. </p>