On Saturday 05 August 2006 5:14 am, Giovanni Bajo wrote: > Luis Miguel Morillas <[EMAIL PROTECTED]> wrote: > > I opened a ticket a few days ago: > > http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/ticket/67 > > > > Any idea about how to solve this problem? > > Luis, I do not have any direct experience with pkg_resources. I expect it > to investigate directories in the sys.path, .pth files, and whatnot to find > out if a module is installed: not really something that could work well > with a frozen application.
pkg_resources is used to find both .egg distributions and package data files (those from distutils package_data setup keyword). It really doesn't look for modules as such. > In fact, what is the reason for a frozen application to ever need > pkg_resources? To find package data files. > It does not make sense to investigate user's Python > installation which might not even exist. For data files, it uses the __loader__ module attribute. If PyInstaller does not support PEP 302, it is seriously broken as the other freezing applications (py2exe, py2app and cx_Freeze) support this just fine. For distributions, however it will scan sys.path for .egg[info] directories and/or files. Currently no freezing applications support this out of the box, but can be tweaked (at least py2exe and cx_Freeze) to include those files so that pkg_resources can find distributions as well. This approach does require additions to user code as well. I personally have no use for pkg_resources, but see a great benefit from supporting PEP 302 import hooks as they make locating package data files much easier and makes the other freezing tools Just Work. It seems to me that PyInstaller is quite behind the curve when compared to the other freezing applications. On the flip side, it is the only freezing application that supports Python versions prior to 2.3. I guess that that is the whole issue as PEP 302 was first implemented in 2.3 so it would cause a fork in the code to support both methods. Which may be why the other applications dropped support for the earlier versions. -- Jeremy Kloth http://4suite.org/ _______________________________________________ PyInstaller mailing list [email protected] http://lists.hpcf.upr.edu/mailman/listinfo/pyinstaller
