“maximum recursion depth exceeded” while packaging py file with py2exe

淺唱寂寞╮ 提交于 2019-12-01 05:49:43

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

import sys
sys.setrecursionlimit(5000)

This error can also occur when you have Jason path.py installed as described here: http://www.py2exe.org/index.cgi/PathModul. The solution from this page is to

Just rename

site-packages/path.py to

site-packages/jpath.py 

and make sure also to toggle your imports to

import jpath

It works for Pyinstaller

Create a spec file

pyi-makespec options name.py 

Modify this spec by adding to start of file

import sys
sys.setrecursionlimit(5000) # or more

Build the executable file

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