pyinstaller creating EXE RuntimeError: maximum recursion depth exceeded while calling a Python object pyinstaller creating EXE RuntimeError: maximum recursion depth exceeded while calling a Python object python python

pyinstaller creating EXE RuntimeError: maximum recursion depth exceeded while calling a Python object


This worked for me

  1. Run pyinstaller and stop it to generate the spec file :

    pyinstaller filename.py

    A file with .spec as extension should be generated

  2. Now add the following lines to the beginning of the spec file :

    import syssys.setrecursionlimit(5000)
  3. Now run the spec file using :

    pyinstaller filename.spec


Mustafa did guide me to the right direction, you have to increase the recursion limit. But the code has to be put to the beginning of the spec file and not in your python code:

# -*- mode: python -*-import syssys.setrecursionlimit(5000)

Create the spec file with pyi-makespec first, edit it and then build by passing the spec file to the pyinstaller command. See the pyinstaller manual for more information about using spec files.

Please make sure to use pyinstaller 3.2.0, with 3.2.1 you will get ImportError: cannot import name 'is_module_satisfies' (see the issue on GitHub)


i'd try to increase recursion depth limit. Insert at the beginning of your file:

import syssys.setrecursionlimit(5000)