简体   繁体   English

Pyinstaller RecursionError:超出最大递归深度

[英]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:我遇到了以下问题,如果我尝试使用 pyinstaller 生成 exe,我会收到以下错误消息:

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.到生成的.spec文件中。 Doing that the.exe is generated successfully.这样就成功生成了.exe。 But if I then try to run the.exe I get the following error:但是,如果我再尝试运行.exe,我会收到以下错误:

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.在另一台计算机上,我安装了旧版本的 Python 和 Pyinstaller,在那里它使用相同的脚本运行得非常好。

try the option --onefile.尝试选项--onefile。 if possible try to simplify your code as best as possible, (eg use modules instead of individual files, etc)如果可能,尽量简化您的代码(例如,使用模块而不是单个文件等)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM