Python: pyinstaller报错【A RecursionError maximum recursion depth exceeded occurred】

The following problems occurred during pyinstaller demo.py:

=============================================================
A RecursionError (maximum recursion depth exceeded) occurred.
For working around please follow these instructions
=============================================================
 
1. In your program's .spec file add this line near the top::
     import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)
2. Build your program by running PyInstaller with the .spec file as
   argument::
     pyinstaller myprog.spec
3. If this fails, you most probably hit an endless recursion in
   PyInstaller. Please try to track this down has far as possible,
   create a minimal example so we can reproduce and open an issue at
   https://github.com/pyinstaller/pyinstaller/issues following the
   instructions in the issue template. Many thanks.

Solution: Open the demo.spec file and add the following two lines

import sys
sys.setrecursionlimit(sys.getrecursionlimit()*5)

insert image description here
Then

pyinstaller demo.spec

you can continue to pack

Guess you like

Origin blog.csdn.net/weixin_35770067/article/details/131463459