From: Tim v. d. L. <tn...@gm...> - 2008-08-27 05:49:09
|
running py2exe running build_py *** searching for required modules *** Traceback (most recent call last): File "D:\Work\ING\Dev\PyMappingVerification\src\setup.py", line 79, in <module> "optimize":2, File "C:\Python25\lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "C:\Python25\lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "C:\Python25\Lib\site-packages\py2exe\build_exe.py", line 228, in run self._run() File "C:\Python25\Lib\site-packages\py2exe\build_exe.py", line 281, in _run self.find_needed_modules(mf, required_files, required_modules) File "C:\Python25\Lib\site-packages\py2exe\build_exe.py", line 1182, in find_needed_modules mf.run_script(path) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 710, in run_script Base.run_script(self, pathname) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 124, in run_script self.load_module('__main__', fp, pathname, stuff) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 727, in load_module r = Base.load_module(self, fqname, fp, pathname, (suffix, mode, typ)) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 314, in load_module self.scan_code(co, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 420, in scan_code self._safe_import_hook(name, m, fromlist, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 329, in _safe_import_hook self.import_hook(name, caller, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 716, in import_hook return Base.import_hook(self,name,caller,fromlist,level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 136, in import_hook q, tail = self.find_head_package(parent, name) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 192, in find_head_package q = self.import_module(head, qname, parent) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 721, in import_module r = Base.import_module(self,partnam,fqname,parent) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 284, in import_module m = self.load_module(fqname, fp, pathname, stuff) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 727, in load_module r = Base.load_module(self, fqname, fp, pathname, (suffix, mode, typ)) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 295, in load_module m = self.load_package(fqname, pathname) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 468, in load_package self.load_module(fqname, fp, buf, stuff) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 727, in load_module r = Base.load_module(self, fqname, fp, pathname, (suffix, mode, typ)) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 314, in load_module self.scan_code(co, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 443, in scan_code self._safe_import_hook(name, m, fromlist, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 329, in _safe_import_hook self.import_hook(name, caller, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 716, in import_hook return Base.import_hook(self,name,caller,fromlist,level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 136, in import_hook q, tail = self.find_head_package(parent, name) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 192, in find_head_package q = self.import_module(head, qname, parent) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 721, in import_module r = Base.import_module(self,partnam,fqname,parent) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 284, in import_module m = self.load_module(fqname, fp, pathname, stuff) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 727, in load_module r = Base.load_module(self, fqname, fp, pathname, (suffix, mode, typ)) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 295, in load_module m = self.load_package(fqname, pathname) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 468, in load_package self.load_module(fqname, fp, buf, stuff) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 727, in load_module r = Base.load_module(self, fqname, fp, pathname, (suffix, mode, typ)) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 314, in load_module self.scan_code(co, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 420, in scan_code self._safe_import_hook(name, m, fromlist, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 329, in _safe_import_hook self.import_hook(name, caller, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 716, in import_hook return Base.import_hook(self,name,caller,fromlist,level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 137, in import_hook m = self.load_tail(q, tail) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 214, in load_tail m = self.import_module(head, mname, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 721, in import_module r = Base.import_module(self,partnam,fqname,parent) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 284, in import_module m = self.load_module(fqname, fp, pathname, stuff) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 727, in load_module r = Base.load_module(self, fqname, fp, pathname, (suffix, mode, typ)) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 314, in load_module self.scan_code(co, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 453, in scan_code self.scan_code(c, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 453, in scan_code self.scan_code(c, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 420, in scan_code self._safe_import_hook(name, m, fromlist, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 329, in _safe_import_hook self.import_hook(name, caller, level=level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 716, in import_hook return Base.import_hook(self,name,caller,fromlist,level) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 137, in import_hook m = self.load_tail(q, tail) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 214, in load_tail m = self.import_module(head, mname, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 721, in import_module r = Base.import_module(self,partnam,fqname,parent) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 284, in import_module m = self.load_module(fqname, fp, pathname, stuff) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 727, in load_module r = Base.load_module(self, fqname, fp, pathname, (suffix, mode, typ)) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 314, in load_module self.scan_code(co, m) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 446, in scan_code self._safe_import_hook(parent.__name__, None, fromlist, level=0) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 344, in _safe_import_hook self._add_badmodule(fullname, caller) File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 321, in _add_badmodule self.badmodules[name][caller.__name__] = 1 AttributeError: 'NoneType' object has no attribute '__name__' |
From: Tim v. d. L. <tn...@gm...> - 2008-08-27 08:25:34
|
Hi, On Wed, Aug 27, 2008 at 7:49 AM, Tim van der Leeuw <tn...@gm...>wrote: > Hi all, > > Deeply inside py2exe, somewhere in the module-finder, I got an exception > last night, which ends with the following: > > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 314, in > load_module > self.scan_code(co, m) > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 446, in scan_code > self._safe_import_hook(parent.__name__, None, fromlist, level=0) > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 344, in > _safe_import_hook > self._add_badmodule(fullname, caller) > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 321, in > _add_badmodule > self.badmodules[name][caller.__name__] = 1 > AttributeError: 'NoneType' object has no attribute '__name__' > > (The complete py2exe output is attached). > > I used to have no problem creating an executable, so I have no idea what > might have changed -- I don't recall upgrading any packages since the last > time I built the executable but I might have, and forgotten about it. > > This happens with py2exe 0.6.8 (which incidentally also seems to take a > long time at this phase). > > I downgraded to py2exe 0.6.6 and within no time, I had an executable. > (Which unfortunately didn't work, because I'd started using relative import > statements since upgrading to 0.6.8 :-( ) > > If anyone could help me, I'd greatly appreciate. > > Regards, > > --Tim > > I hadn't yet posted the python-version used and the list of installed modules. List of Python Modules and Versions: - Python 2.5.2 - Py2Exe 0.6.8 - SetupTools 0.6c8 - 4Suite-XML 1.0.2 - Amara 1.2.0.2 - Comtypes 0.5.1 - PIL-1.1.6 - Psyco 1.6 (not used in this program, but imported in setup.py) - pyPdf-1.10 (not used in this program) - PyWin32-212 (not used anylonger in this program) - Pywinauto-0.3.7 - SendKeys-0.3 - wxPython 2.8.8.1 (Unicode) Furthermore the following are installed: - wxGlade 0.6.3 - TortoiseHg-0.4.1 - Mercurial-0.9.5 - Python 3.0a5 - GIMP 2.4.6 (And lots more that doesn't seem anyhow Python related) However, these packages shouldn't affect the Python 2.5 installation. Actually, thinking about it, the only change in configuration since the last time I built an executable is probably the installation of psyco, so I'll start doing some variations with that. However, the same set of installed modules but with py2exe 0.6.6 instead of 0.6.8 works, no problems, and much faster module-finder. Regards, --Tim van der Leeuw |
From: Werner F. B. <wer...@fr...> - 2008-08-27 10:34:57
|
Tim, I am using similar packages and 0.6.8 doesn't cause me any problems. As you installed a new version of py2exe, did you clear the build folder? Werner |
From: Tim v. d. L. <tn...@gm...> - 2008-08-27 10:37:55
|
Hi Werner, On Wed, Aug 27, 2008 at 12:34 PM, Werner F. Bruhin <wer...@fr...>wrote: > Tim, > > I am using similar packages and 0.6.8 doesn't cause me any problems. > > As you installed a new version of py2exe, did you clear the build folder? > Yes I did try that after I got this exception, and as I mentioned, I did successfully build several binaries with py2exe version 0.6.8. I didn't yet have a chance to try building without psyco, however. (Busy with other work that also needs to happen) Regards, --Tim > > Werner > > |
From: Thomas H. <th...@ct...> - 2008-08-27 13:33:10
|
Tim van der Leeuw schrieb: > Hi all, > > Deeply inside py2exe, somewhere in the module-finder, I got an exception > last night, which ends with the following: > > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 314, in > load_module > self.scan_code(co, m) > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 446, in scan_code > self._safe_import_hook(parent.__name__, None, fromlist, level=0) > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 344, in > _safe_import_hook > self._add_badmodule(fullname, caller) > File "C:\Python25\Lib\site-packages\py2exe\mf.py", line 321, in > _add_badmodule > self.badmodules[name][caller.__name__] = 1 > AttributeError: 'NoneType' object has no attribute '__name__' > > (The complete py2exe output is attached). > > I used to have no problem creating an executable, so I have no idea what > might have changed -- I don't recall upgrading any packages since the last > time I built the executable but I might have, and forgotten about it. > > This happens with py2exe 0.6.8 (which incidentally also seems to take a long > time at this phase). Could be a bug in the (new) modulefinder. Can you try to prepare a script that lets me reproduce and debug the problem? Thanks, Thomas |
From: Tim v. d. L. <tn...@gm...> - 2008-08-27 13:45:05
|
Hi Thomas, On Wed, Aug 27, 2008 at 3:33 PM, Thomas Heller <th...@ct...> wrote: > Tim van der Leeuw schrieb: > > Hi all, > > > > Deeply inside py2exe, somewhere in the module-finder, I got an exception > > last night, which ends with the following: > [...] > > > > This happens with py2exe 0.6.8 (which incidentally also seems to take a > long > > time at this phase). > > Could be a bug in the (new) modulefinder. Can you try to prepare a script > that lets me reproduce and debug the problem? > Already working on it... it seems to be something to do with relative imports but I don't yet know in which form exactly. > > Thanks, > Thomas > > Regards, --Tim |
From: Thomas H. <th...@ct...> - 2008-08-29 17:36:44
|
Tim sent me a sample that let me reproduce the problem. In case anyone else is suffering from this here is my reply: Thanks. I can reproduce the problem now and am working on a solution. A quick fix is to replace the _add_badmodule() method in Lib\site-packages\py2exe\mf.py, line 322, with this one: def _add_badmodule(self, name, caller): if name not in self.badmodules: self.badmodules[name] = {} if caller: self.badmodules[name][caller.__name__] = 1 else: self.badmodules[name]["-"] = 1 -- Thanks, Thomas |
From: Tim v. d. L. <tn...@gm...> - 2008-08-29 17:51:39
|
On Fri, Aug 29, 2008 at 7:36 PM, Thomas Heller <th...@ct...> wrote: > Tim sent me a sample that let me reproduce the problem. In case anyone > else is suffering > I tried sending the sample to the list too, but the list-manager refused zip-attachments. I didn't yet get round to repackaging it as 7-zip archive and sending it to the list as well. Regards, --Tim |
From: Thomas H. <th...@ct...> - 2008-08-29 17:54:31
|
Tim van der Leeuw schrieb: > On Fri, Aug 29, 2008 at 7:36 PM, Thomas Heller <th...@ct...> wrote: > >> Tim sent me a sample that let me reproduce the problem. In case anyone >> else is suffering >> > I tried sending the sample to the list too, but the list-manager refused > zip-attachments. I didn't yet get round to repackaging it as 7-zip archive > and sending it to the list as well. That's no problem (for me, at least). I do not know why the list refused the post that I cc'd to you but I don't have enough time to find out. -- Thanks, Thomas |
From: James T. <ja...@ja...> - 2008-10-09 10:04:24
|
On 30/08/2008 3:36 AM, Thomas Heller wrote: > Tim sent me a sample that let me reproduce the problem. In case anyone else is suffering > from this here is my reply: ... Has a fix been found for this issue yet? If it helps, I discovered that it relates to relative imports, but only when importing a class from a relative module/package; e.g.: from . import TestClass The work around works well enough; I was just curious, as I am experiencing this issue as well. Jamie -- James Teh Email: ja...@ja... WWW: http://www.jantrid.net/ MSN Messenger: ja...@ja... Jabber: jt...@ja... Yahoo: jcs_teh |