title: Embedding Python in C++: Failing to import from the same directory
body: <p>Within a larger class I have a section of code for importing a python script and running it. The file (animate.py) is contained within the same directory as the executable. </p>
  
  <pre><code>void classname::show( void )
  {
           stringstream run_cmd;
           run_cmd &lt;&lt; "animate.run('" &lt;&lt; name &lt;&lt; "')";
  
           Py_Initialize();
           PyRun_SimpleString("import animate");
           PyRun_SimpleString(run_cmd.str().c_str());
           Py_Finalize();
  }
  </code></pre>
  
  <p>The thing is, I'm working through two computers, when compiled on one of these, this works fine. On my personal laptop it fails to import the scipt with the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  ImportError: No module named animate
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  NameError: name 'animate' is not defined
  </code></pre>
  
  <p>They're both compiled through the exact same makefile, with the <code>-lpython2.7</code> flag used. The file structure is also the same.</p>
  
  <p>Is there some library I'm missing to do this?</p>