title: PyImport_Import fails (returns NULL)
body: <p>I am a newbie in python, so may be this is a silly question. I want to write simple c program with embedded python script. I have two files:</p>
  
  <p>call-function.c:</p>
  
  <pre><code>    #include &lt;Python.h&gt;
      int main(int argc, char *argv[])
      {
          PyObject *pName, *pModule, *pDict, *pFunc, *pValue;
  
          if (argc &lt; 3)
          {
              printf("Usage: exe_name python_source function_name\n");
              return 1;
              }
  
          // Initialize the Python Interpreter
          Py_Initialize();
  
          // Build the name object
          if ((pName = PyString_FromString(argv[1])) == NULL) {
              printf("Error: PyString_FromString\n");
              return -1;
          }
  
          // Load the module object
          if ((pModule = PyImport_Import(pName)) == NULL) {
              printf("Error: PyImport_Import\n");
              return -1;
          }
  
          // pDict is a borrowed reference 
          if ((pDict = PyModule_GetDict(pModule))==NULL) {
              printf("Error: PyModule_GetDict\n");
              return -1;
          }
  ...
  </code></pre>
  
  <p>and </p>
  
  <p>hello.py:</p>
  
  <pre><code>def hello():
      print ("Hello, World!")
  </code></pre>
  
  <p>I compile and run this as follows:</p>
  
  <pre><code>gcc -g -o call-function call-function.c -I/usr/include/python2.6 -lpython2.6
  ./call-function hello.py hello
  </code></pre>
  
  <p>and have this:</p>
  
  <pre><code>Error: PyImport_Import
  </code></pre>
  
  <p>i.e. PyImport_Import returns <code>NULL</code>. Could you help me with this issue? Any help will be appreciated.</p>
  
  <p>Best wishes,</p>
  
  <p>Alex</p>