On the same note, is there a way to exclude it from bundling specific .py files?

We would like to update the  main application using the preloader, but since py2exe will bundle the files, we wouldn't be able to do that. Would we be able to use a custom importer in the same way to import the .py file (Obviously compiled) outside of the .exe, just like we would with the Lib files?

On Mon, Aug 8, 2011 at 5:20 AM, Massa, Harald Armin <chef@ghum.de> wrote:
Basically, once py2exe is used, Python does not see/use the Lib folder

that is the expected behavious. py2exe goes through great pains to load modules from the library.zip or, in case of single-file-distribution, from the library file integrated in the single file.

That behaviour can be changed. You have to add your "own" importer (which should be nothing more then the standard file-system-importer) to the chain of importers

I do not know of a one click solution. Read up on importers:

(The "import chain" has to be modified within your application when py2exed.)

It is definitely possible to solve your challenge; to read more background you may use the google words "python custom importer". 

Best wishes


Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart

Amtsgericht Stuttgart, HRB 734971
et programmare
Python consulting & development & training