欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

(2020.1.2已解决)pyinstaller生成exe出错:RecursionError: maximum recursion depth exceeded

程序员文章站 2024-03-21 17:11:46
...
  • 问题描述

    如题所述:

    (2020.1.2已解决)pyinstaller生成exe出错:RecursionError: maximum recursion depth exceeded

  • 解决方案1

    采用pyinstaller -F target.py生成exe过程中,会生成一个target.spec文件,在此文件第二行加上如下两句:

    import sys
    sys.setrecursionlimit(5000) # 设置递归深度
    

    然后运行此文件:

    pyinstaller target.spec
    

    因为Python的默认递归深度是1000,超过即会报错。

  • Refereneces


  1. pyinstaller creating EXE RuntimeError: maximum recursion depth exceeded while calling a Python object ↩︎