title: How to allow 3rd-party libraries to be imported by scripts called in embedded Python interpreter?
body: <p>I have embedded a Python 2.7.2 interpreter into a C++ application using the Python C API.</p>
  
  <p>On the target machines, I can't guarantee a Python install, so I am trying to get the embedded interpreter to look at the folder where my application resides.  So in the application diectory, I have the Lib, Libs and DLLs folder for Python.</p>
  
  <p>In the code, I have used Py_SetPythonHome() an Py_SetProgramName() to get Python loaded and also to allow standard libraries to be installed.</p>
  
  <p>One of the test scripts I'm using has:</p>
  
  <pre><code>import csv
  
  import numpy
  </code></pre>
  
  <p>The csv line is now fine.  Within the \libs directory I can see site-packages\numpy.  But the import crashes on this line.  I am using numpy 1.6.1 for this.</p>
  
  <p>I think I might need to change the module search path - is this right and what is the best way to achieve this to allow third-party libraries like numpy to be accessible to my scripts?  You can assume that I could produce an absolute path to the numpy directory if that would help.</p>
  
  <p>EDIT:  More information - I've managed to produce the traceback and the error I'm getting is in \numpy\core\_<em>init</em>_.py when it tries the line "import multiarray" with the error "ImportError: DLL load failed: The specified module connot be found".  Checking the directory, I find a multiarray.pyd.  Any thoughts?</p>