On Friday 28 July 2006 1:12 am, you wrote: > Luis Miguel Morillas wrote: > > I want to freeze a 4Suite app (a graphical python shell with Ft lib) > > But I'm having problems when I import some Ft's modules. I can't find > > how to debug this problem. I've tried hook- files with no success :-/ > > This is the last trace of a single program: > > http://livingpyxml.python-hosting.com/wiki/SingleFtPyInstaller > > The problem is that PyImport_ImportModuleEx, as explained in the Python > documentation, bypasses all import hooks and go directly to the Python > impot machinery. So, there is basically nothing that PyInstaller can do to > *intercept* these imports and extract the .pyc files from the internal > package. I believe that any other packager like py2exe will fail as well.
PyImport_ImportModuleEx does not bypass *import hooks* (see PEP 302), which BTW, is how both py2exe and cx_Freeze work (and successfully work with 4Suite). It does however bypass any modifications to the __import__ function. Hooking into the import machinery using __import__ is fragile at best and has been deprecated in favor of PEP 302 import hooks. In this case, I would suggest that PyInstaller needs to be updated to support PEP 302 for those Python versions that support it (Python 2.3+). I guess that I can look into changing the current use of ImportModuleEx (as we've made other changes to support the other "freezing" utilities). -- Jeremy Kloth http://4suite.org/ _______________________________________________ PyInstaller mailing list [email protected] http://lists.hpcf.upr.edu/mailman/listinfo/pyinstaller
