From: Werner F. B. <wer...@fr...> - 2009-10-14 16:50:20
|
Jamal, Jamal Mazrui wrote: > Since py2exe does not find modules in .egg archives, can anyone suggest > a general procedure for adapting such an installation so that it is > compatible with py2exe? For example, I have had some success > unarchiving the .egg into a subdirectory of my application directory, > but evidently there is more to it because I typically still need to > tweek code in .py source files so that it works properly. I use this type of code to install packages like sqlalchemy and pytz. easy_install.main(['-Zmaxd', sitePKG, egg]) And then I use in my app and in py2exe setup code like this. if not hasattr(sys, 'frozen'): import pkg_resources pkg_resources.require("sqlalchemy") # get latest version Note the above is only needed if you do a multi version easy_install. And also in the setup.py I need: packages = ['email', 'Ft', 'kinterbasdb', 'pytz', 'setuptools', 'sqlalchemy'] However I haven't gotten it to work with e.g. amara or pyparsing. Haven't had time yet to try and figure it out and I have non egg installs of these packages. Werner |