title: PyImport_Import fails silently and execution of code stops without errors
body: <p>I'm trying to implement aprecision index in a Turbodecode algorythm written in C. After finding a way to do that i'm trying to embedd a python function in order tu use matplotlib and plot a graph showing the precision of the decoder.</p>
  
  <p>Problem is trying embedding stops at PYImport_Import() without going anyfurther and without giving any error message.</p>
  
  <p>my python file is called plot.py
   and inside it is a simple:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  def show_plt(max_x, y):
      print("enter")
      fig, ax1 = plt.subplots()
      x_array = range(0,max_x+1)
      ax1.plot(x_array, y)
      plt.show()
  </code></pre>
  
  <p>while my C part of code where i'm trying to call this python function is written like this:</p>
  
  <pre><code>#include &lt;python2.7/Python.h&gt;
  
  ...
  
  if (decision)
      {
          printf("here1\n");
          Py_Initialize();
          //PyRun_SimpleString("import sys; sys.path.append('.')");
          decoded = malloc(packet_length * sizeof *decoded);
          double est[packet_length];
          PyObject *tuple = PyList_New(packet_length);
          for (int i = 0; i &lt; packet_length; ++i)
          {
              double one = app[1][i] + extrinsic[1][i];
              double zero = app[0][i] + extrinsic[0][i];
              double delta = abs(one + zero);
              if (delta &gt; 150)//THRESHHOLD TO DEFINE
                  delta = 150;
              est[i] = (150 - delta) / 150;
              PyList_Append(tuple,PyFloat_FromDouble(est[i]));
              decoded[i] = one &gt; zero;
          }
          printf("here2\n");
          PyObject *myModuleString = PyString_FromString((char *)"plot");    
          printf("here3\n");
          PyObject *myModule = PyImport_Import(myModuleString);
          printf("here4\n");
          PyObject *myFunction = PyObject_GetAttrString(myModule, (char *)"show_plt");
          printf("here5\n");
          PyObject *args = PyTuple_Pack(2, packet_length, tuple);
          printf("here6\n");
          PyObject_CallObject(myFunction, args);
          printf("here7\n");
      }
  </code></pre>
  
  <p>note that code stops after printf("here3") without errors.</p>
  
  <p>I'm not familiar with calling python functions in C so any help would be most appreciated.</p>