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

痴心易碎 提交于 2019-11-28 05:02:23

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 sys
sys.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)

Aviral

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
    

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

import sys
sys.setrecursionlimit(5000)
user11855545

You can make changes to the recursion limit in the following manner:

import sys
sys.setrecursionlimit(1000)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!