Path Module and Py2exe

Fuzzyman michael at foord.net
Wed Mar 24 03:26:26 EST 2004


Has anyone succesfully used py2exe with the (excellent) path module by
Jason Orendorff ?

I use it regularly but tried to 'bundle' one of my applications that
used it with py2exe last night. It failed with a 'maximum recursion
depth' error in module finder - the full error report is below. It's
obviously got some kind of 'cylical' error in the module importing
code - which it isn't catching. I finally managed to isolate path as
the source of the problem.

A simple script that imports path and just prints path.getcwd() fails
with the same error when I try to 'compile' it (I know, I know..)
using py2exe.

Unfortunately - if unresolvable - this will stop me using the module.

I wondered if anyone had seen this before, or had any suggestions as
to how to overcome this ?

>>> running py2exe
*** searching for required modules ***
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "F:\Python Projects\test\setup.py", line 8, in ?
    scripts=["songbase.pyw"],
  File "c:\python23\lib\distutils\core.py", line 149, in setup
    dist.run_commands()
  File "c:\python23\lib\distutils\dist.py", line 907, in run_commands
    self.run_command(cmd)
  File "c:\python23\lib\distutils\dist.py", line 927, in run_command
    cmd_obj.run()
  File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 187,
in run
    self.find_needed_modules(mf, required_files, required_modules)
  File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 814,
in find_needed_modules
    mf.run_script(self.get_boot_script("common"))
  File "C:\Python23\lib\modulefinder.py", line 112, in run_script
    self.load_module('__main__', fp, pathname, stuff)
  File "C:\Python23\lib\modulefinder.py", line 285, in load_module
    self.scan_code(co, m)
  File "C:\Python23\lib\modulefinder.py", line 342, in scan_code
    self._safe_import_hook(name, m, fromlist)
  File "C:\Python23\lib\modulefinder.py", line 300, in
_safe_import_hook
    self.import_hook(name, caller)
  File "C:\Python23\lib\modulefinder.py", line 124, in import_hook
    q, tail = self.find_head_package(parent, name)
  File "C:\Python23\lib\modulefinder.py", line 166, in
find_head_package
    q = self.import_module(head, qname, parent)
  File "C:\Python23\lib\modulefinder.py", line 255, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "C:\Python23\lib\modulefinder.py", line 285, in load_module
    self.scan_code(co, m)
.
.
.
.
  File "C:\Python23\lib\modulefinder.py", line 285, in load_module
    self.scan_code(co, m)
  File "C:\Python23\lib\modulefinder.py", line 342, in scan_code
    self._safe_import_hook(name, m, fromlist)
  File "C:\Python23\lib\modulefinder.py", line 300, in
_safe_import_hook
    self.import_hook(name, caller)
  File "C:\Python23\lib\modulefinder.py", line 124, in import_hook
    q, tail = self.find_head_package(parent, name)
  File "C:\Python23\lib\modulefinder.py", line 166, in
find_head_package
    q = self.import_module(head, qname, parent)
  File "C:\Python23\lib\modulefinder.py", line 255, in import_module
    m = self.load_module(fqname, fp, pathname, stuff)
  File "C:\Python23\lib\modulefinder.py", line 285, in load_module
    self.scan_code(co, m)
  File "C:\Python23\lib\modulefinder.py", line 342, in scan_code
    self._safe_import_hook(name, m, fromlist)
  File "C:\Python23\lib\modulefinder.py", line 300, in
_safe_import_hook
    self.import_hook(name, caller)
  File "C:\Python23\lib\modulefinder.py", line 123, in import_hook
    parent = self.determine_parent(caller)
  File "C:\Python23\lib\modulefinder.py", line 133, in
determine_parent
    self.msgin(4, "determine_parent", caller)
RuntimeError: maximum recursion depth exceeded
>>> 


Regards,



Fuzzy

http://www.voidspace.org.uk/atlantibots/pythonutils.html



More information about the Python-list mailing list