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 sys
    sys.setrecursionlimit(5000)
    
  3. Now run the spec file using :

    pyinstaller filename.spec
    

Leave a Comment