0

I'm trying to build an exe from a Python source using py2exe. The Python script is a service that imports and uses APScheduler module. I haven't been able to produce a working .exe since when I added APScheduler to my code.

Every time I try to build the .exe file I get an error like this one:

 File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 120, in import_hook
    module = self._gcd_import(name)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import
    return self._find_and_load(name)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 298, in _find_and_load
    getattr(parent_module, name.rpartition('.')[2])
  File "C:\Python34\lib\site-packages\py2exe\hooks.py", line 291, in __getattr__
    self.__finder.safe_import_hook(renamed, caller=self)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 135, in safe_import_hook
    self._info(name, caller, fromlist, level)
RuntimeError: maximum recursion depth exceeded

I wasn't able to find any reference in the documentation of both modules, nor I've been able to find something around the net. I'm pretty sure the reason of the error is a conflict between the two modules because a tried to exclude APScheduler in setup.py and the program compiled (obviously it's not running, that piece of software is missing). I already excluded also six.moves.urllib.parse, as pointed in this thread.

I'm very interested to know if:

  1. Is anyone familiar with this issue
  2. Should I report this as a bug? If yes, is a Py2exe bug or a APScheduler bug

Thank for any assistance.

Community
  • 1
  • 1
jekbau
  • 61
  • 9

1 Answers1

0

Try this:

from distutils.core import setup

import sys

sys.setrecursionlimit(15000)

import py2exe

setup(...)