简体   繁体   English

Pyinstaller打包的应用程序在启动时崩溃

[英]Pyinstaller packaged app crashes on launch

I know this is a problem that's been asked here a bundle of times before, but I'm seriously at my wits end with this thing. 我知道这是一个问题,以前曾在这里被问过很多次,但是我很认真地对待这个问题。 I'm learning Python 3 and I decided I'd work on a little text based game. 我正在学习Python 3,因此决定要开发一款基于文本的小游戏。 I made some good progress, got most of a tutorial done, title card, half of a save file system written, etc. I decided, hey, I should try and see if I can package this thing before I go any further (because where's the fun in not showing your friends?). 我取得了一些不错的进步,完成了大部分教程,标题卡,一半的保存文件系统,等等。我决定,嘿,我应该尝试看看是否可以打包此东西,然后再继续(因为在哪里)不向您的朋友展示的乐趣?)。

I've used Pyinstaller before on some simple one file apps (dice rollers, etc.) and it worked flawlessly. 之前,我已经在一些简单的单文件应用程序(骰子滚轴等)上使用了Pyinstaller,它可以完美地工作。 However, I'm having a hell of a time with my larger game. 但是,我在玩大型游戏时遇到了麻烦。

When I bundle it with Pyinstaller it throws a ton of missing lib errors. 当我将其与Pyinstaller捆绑在一起时,会抛出大量缺少的lib错误。 I Googled around and those are apparently not a huge issue. 我在Google周围搜索,这些显然不是一个大问题。 Aside from that, everything seems to have run just fine... until I go to launch the program. 除此之外,一切似乎都运行良好……直到我启动该程序。 It's just a simple program that runs in the command line, but when I launch it it crashes immediately. 这只是一个在命令行中运行的简单程序,但是当我启动它时,它立即崩溃。

Now, I thought maybe this had to do with the modules I imported (or the fact that the program relies on calling from multiple .py files). 现在,我认为这可能与我导入的模块有关(或者该程序依赖于从多个.py文件进行调用的事实)。 So I made a smaller program that includes all the same imports and calls to an external file, and that one packaged and launched just fine! 因此,我制作了一个较小的程序,其中包含所有相同的导入和对外部文件的调用,并且打包并启动了该程序! So at this point, the working hypothesis is that there's something rightly messed with my code, but I can't for the life of me figure out what it is. 因此,在这一点上,可行的假设是我的代码中有些东西是正确的,但是我无法终生弄清楚它是什么。

Here's a link to the program itself: https://www.dropbox.com/s/ouog4ccbibpibgx/AsciiLand.zip?dl=0 这是程序本身的链接: https : //www.dropbox.com/s/ouog4ccbibpibgx/AsciiLand.zip?dl=0

Seriously, I've been at this all day and I've made exactly zero progress. 认真地说,我整整一天都在工作,而我取得的进展恰恰是零。 Any help would be greatly appreciated here guys. 任何帮助将在这里非常感谢你们。

Seems like I found the problem. 好像我发现了问题。 While it honestly just raises more problems, I'm gonna accept it for now. 老实说这只会带来更多问题,但现在我要接受。

Looks like Pyinstaller has some serious issues with PyFiglet. 看起来Pyinstaller的PyFiglet存在严重问题。 Everything compiled fine when I removed the PyFiglet output. 当我删除PyFiglet输出时,一切编译正常。 I have absolutely zero idea as to why, but oh well. 我对原因绝对不为零 ,但是哦。

For anyone in the future looking for answers to this, here's the command for compiling. 对于将来寻求解决方案的任何人,这里是编译命令。 You just need to add the Pyfiglet fonts directory to pyinstaller. 您只需要将Pyfiglet字体目录添加到pyinstaller。

pyinstaller --add-data "C:/Python36/Lib/site-packages/pyfiglet";./pyfiglet --onefile myprogram.py pyinstaller --add-data“ C:/ Python36 / Lib / site-packages / pyfiglet”; ./ pyfiglet --onefile myprogram.py

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

相关问题 如何使用pyinstaller整理打包的Python应用程序? - How to tidy up a packaged Python app with pyinstaller? 使用 PyInstaller 打包的 PySide6 应用程序启动时没有错误 - PySide6 app packaged with PyInstaller not starting with no errors PyInstaller打包应用程序在控制台模式下工作正常,在窗口模式下崩溃 - PyInstaller packaged application works fine in Console mode, crashes in Window mode PyInstaller打包的PyQt5应用在MacOS上使用了错误的样式 - PyInstaller-packaged PyQt5 app uses wrong style on MacOS Flask 应用程序与 PyInstaller 一起打包,没有模板也没有 static 包含在 EXE 中 - Flask app packaged with PyInstaller with no templates nor static included in EXE 使用pyinstaller打包后,Kivy应用程序崩溃了 - Kivy app crashes after packaging with pyinstaller Python:用 pyinstaller 打包的 opencv 出错 - Python: Error with opencv packaged with pyinstaller PyInstaller打包的flask应用程序无法加载Python库,dlopen->找不到映像 - PyInstaller packaged flask app failes to load Python Library, dlopen -> image not found 打包的Python应用程序(PyInstaller或cx_freeze)中的json.load / simplejson.load失败 - json.load / simplejson.load fails in packaged Python app (PyInstaller or cx_freeze) 当单击退出按钮时,PyInstaller 构建的 Python 应用程序崩溃 - Python app built by PyInstaller crashes when exit button is clicked
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM