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

关于pyinstaller知识汇总参见《Python中pyinstaller如何打包生成exe文件及可能问题汇总》

  • 问题描述

    如题所述:

    在这里插入图片描述

  • 解决方案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 ↩︎

发布了753 篇原创文章 · 获赞 1021 · 访问量 54万+

猜你喜欢

转载自blog.csdn.net/The_Time_Runner/article/details/103802875