title: Python C API segmentation fault when importing library in py file
body: <p>I am trying to run a python program from a C program.</p>
  <p>However when I add the line <code>import signal</code>  in my .py file I get a segmentation fault.</p>
  <p>Using GDB I saw that the line <code>pModule = PyImport_Import(pName);</code> returns a NULL value.</p>
  <pre><code>(gdb) print pModule
  $1 = (PyObject *) 0x0
  </code></pre>
  <p>When I remove the line <code>import signal</code> in python the module loads correctly.
  Do you know how to fix this ?</p>
  <p>Here is my python code:</p>
  <pre><code>import signal
  
  def main(person):
      print(&quot;DANS PYTHON&quot;)
      return &quot;What's up &quot; + person;
  </code></pre>
  <p>And here is my C code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;Python.h&gt;
  
  void main(void) {
      Py_Initialize();
      PyObject *pName,*pName2, *pModule, *pFunc, *pArgs, *pValue;
      PySys_SetPath(L&quot;.&quot;);    
      pName = PyUnicode_FromString((char*)&quot;main&quot;);                 
      pModule = PyImport_Import(pName);   
      pFunc = PyObject_GetAttrString(pModule, (char*)&quot;main&quot;);      
      pArgs = Py_BuildValue(&quot;(s)&quot;,(char *)&quot;137912500&quot;); 
      pValue = PyObject_CallObject(pFunc, pArgs);                  
      Py_Finalize();                                               
      return;
  }
  </code></pre>
  <p>I am working with Ubuntu 20.04</p>
  <p>Thanks in advance for your help</p>