On Fri, Dec 21, 2007 at 01:30:35AM -0600, Jeff Rush wrote:
- How to isolate the embedded interpreter from environmental effects. I
have found that on occasion, the interpreter would pick up "stray" installations which can cause weird problems. Which environmental settings affect the startup of an embedded Python interpreter? How does one work around/remove those dependencies? Is there any information available about how exactly the startup works? What is being read/loaded in which order etc?
If you are picking up stray installations it is probably through the PYTHONPATH environment variable. For a brief understanding of these, run the command "python --help". For your embedded world, you ought to change your distributed code to use a different environment variable, maybe a prefix or suffix.
You can also set the Py_IgnoreEnvironmentFlag to 0 before calling Py_Initialize(). This is the equivalent of running python with the -E command line option:
-E : ignore environment variables (such as PYTHONPATH)