From: Greg C. <gtc...@ea...> - 2004-08-30 15:59:49
|
Thanks very much. I'll try to check this out tomorrow. Greg On Thu, 2004-08-26 at 07:24, Thomas Heller wrote: > Greg <gtc...@ea...> writes: > > > Thomas Heller <theller <at> python.net> writes: > > > >> > >> I think it is because the *only* entry in sys.path is the library.zip > >> file. > >> > >> See <http://starship.python.net/crew/theller/moin.cgi/Py2exeEnvironment> > >> > >> You should probably in your script check for the sys.frozen attribute, > >> and extend sys.path yourself. > >> > > > > I think I'm dense, because I'm not having luck with this. I have a python > > application, which is laid out like: > > > > app.py > > dir\anotherdir\dynamic1.py > > dir\anotherdir\dynamic2.py > > dir\anotherdir\dynamic3.py > > dir\anotherdir\dynamic4.py > > dir\anotherdir\dynamic5.py > > > > At runtime, dynamic[1-5].py is dynamically loaded, based on application > > configuration. Obviously, the module finder is not finding these modules. When > > I look in the library.zip file, they are not being added. How can I force these > > modules to be included in library.zip? > > Is dir\anotherdir on sys.path when py2exe runs? If so, you only need to > tell py2exe to include them, for example with the command line switch > '--includes dynamic1,dynamic2,dynamic3,dynamic4,dynamic5'. > > If it is not on sys.path, you must either extend the path that > modulefinder uses by extending it in your setup script, additionally to > the above command line switch. > > > I manually added these files to the library.zip file, and it worked, > > but I'd much prefer an automated solution. What are my options here? > > For additional fun (?), you could extend py2exe so that it adds the files to > the library.zip file after the build process is done - see > py2exe\samples\extending\setup.py how to do this. > > > > I read the above link and played, but it does not appear to fixing my > > problem. Like I said, I must be dense, because I can't see that the > > above link is the solution. > > Probably I misunderstood your original question. > > Thomas -- Greg Copeland <gtc...@ea...> |