Search code examples
pythonpipsetuptoolscx-freeze

Building error with setuptools: RuntimeError


I've been using cxFreeze to build my Python code for some time and had no issue, until today. I'm not sure the problem comes from cxFreeze, though. Although there are some RuntimeError exceptions on the web, they don't exactly match what I obtain.

$ python2.7 setup.py build
running build
running build_exe
Traceback (most recent call last):
  File "setup.py", line 79, in <module>
    executables = [client, updater, dbg_updater]
  File "C:\python27\lib\site-packages\cx_Freeze\dist.py", line 362, in setup
    distutils.core.setup(**attrs)
  File "C:\python27\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\python27\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\python27\lib\site-packages\cx_Freeze\dist.py", line 232, in run
    freezer.Freeze()
  File "C:\python27\lib\site-packages\cx_Freeze\freezer.py", line 619, in Freeze
    self.finder = self._GetModuleFinder()
  File "C:\python27\lib\site-packages\cx_Freeze\freezer.py", line 378, in _GetModuleFinder
    finder.IncludePackage(name)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 686, in IncludePackage
    module = self._ImportModule(name, deferredImports)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 346, in _ImportModule
    deferredImports, namespace = namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 419, in _InternalImportModule
    namespace = namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 436, in _InternalImportModule
    parentModule, namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 448, in _LoadModule
    namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 513, in _LoadPackage
    self._LoadModule(name, fp, path, info, deferredImports, parent)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 502, in _LoadModule
    self._ScanCode(module.code, module, deferredImports)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 601, in _ScanCode
    module, relativeImportIndex)
......................................
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 356, in _ImportModule
    deferredImports, namespace = namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 436, in _InternalImportModule
    parentModule, namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 502, in _LoadModule
    self._ScanCode(module.code, module, deferredImports)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 601, in _ScanCode
    module, relativeImportIndex)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 356, in _ImportModule
    deferredImports, namespace = namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 436, in _InternalImportModule
    parentModule, namespace)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 449, in _LoadModule
    module = self._AddModule(name)
  File "C:\python27\lib\site-packages\cx_Freeze\finder.py", line 213, in _AddModule
    module = self._modules[name] = Module(name)
RuntimeError: maximum recursion depth exceeded while calling a Python object

No idea what is creating the bug. I didn't add in any new module and just fixed some errors in my program. I have the most recent version of pip and setuptools. Does anyone know what this error mean?

If you want to see the code, it's here: https://github.com/vlegoff/cocomud/blob/master/src/setup.py

Thanks in advance!

EDIT: It turned out all the fuss was because of the parse module (pypi.python.org/pypi/parse), although it's not included in the project I was trying to freeze. I removed it with pip uninstall and it worked when I tried to freeze my project. No idea why, I did it because I remember having installed two new packages to try them out.


Solution

  • It turned out all the fuss was because of the parse module (pypi.python.org/pypi/parse), although it's not included in the project I was trying to freeze. I removed it with pip uninstall and it worked when I tried to freeze my project. No idea why, I did it because I remember having installed two new packages to try them out.