python - Pyinstaller RecursionError: maximum recursion depth exceeded
问题描述
I got the following problem, that if I try to generate an exe using pyinstaller I get the following error message:
RecursionError: maximum recursion depth exceeded while calling a Python object
I found a lot of solutions saying that I should add
import sys
sys.setrecursionlimit(5000)
into the .spec file which is generated. Doing that the .exe is generated successfully. But if I then try to run the .exe I get the following error:
Failed to execute script pyi_rth_pkgres
Tried a lot of different solutions provided in other posts but none worked. Is there anybody who has an idea how to fix it? I'm using
PyInstaller: 3.6
Python: 3.7.6 (conda)
On Another computer I had an older version of Python and Pyinstaller installed and over there it worked perfectly fine with the same script.
解决方案
尝试选项--onefile。如果可能,尽量简化您的代码(例如,使用模块而不是单个文件等)
推荐阅读
- image-size - 当我将它们缩小时,图像看起来真的很糟糕
- python - 如何在pygame中删除图像?
- laravel - 服务器上的 Laravel 未加载样式表文件
- vue.js - 在 vueJS 中使用生命周期钩子将类添加到正文
- vba - 无法截取定义范围的屏幕截图 (JPEG)
- amazon-ecs - ECS容器中运行的进程能否在运行时确定其服务名称?
- sql - 唯一索引有什么用?
- winapi - ClientRect 神秘地比 WindowRect 小?
- java - 在按名称过滤的 Eclipse 上运行 junit 测试
- javascript - Paypal 按钮将 JSESSIONID 发送到 Spring 安全后端