I started with a working Python/C++ hybrid application, and I'm now trying to create a distribution using py2exe.  The GUI is written in wxWidgets (Python binding), and there's a C++ API exported to Python via boost.python.  The C++ code creates its own embedded Python interpreter and uses it to load and run extension modules from source while the app is running.  These modules may not exist at the time py2exe is run, so naturally it can't include them in the distribution.  After running py2exe, when trying to load these modules at runtime, the embedded interpreter's PyImport_Import() function fails.  The contents of the module don't seem to matter... event those that don't import any other modules fail to load.

So here's the question:
Does the embedded interpreter require an installed Python distribution to load extenal modules, or can it somehow get everything it needs from the distribution created by py2exe?

Many thanks for any insight into this problem...


Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!