如何将 GUI python 程序编译成 .exe

How can I compile a GUI python program into .exe

我正在使用 Python 3.7.0 和 tkinter 创建一个可执行的 GUI

我已经尝试使用 PyInstaller 创建可执行 GUI,它不会抛出错误,但是当我 运行 程序 windows 显示一条错误消息时。

当我单击“显示问题详细信息”时,显示的是这样的内容:

Problem Event Name: APPCRASH
 Application Name:  Jpeg-Raw_WizardGUI.exe
 Application Version:   0.0.0.0
 Application Timestamp: 5a2e9f94
 Fault Module Name: ucrtbase.DLL
 Fault Module Version:  10.0.10240.16390
 Fault Module Timestamp:    55a5bf73
 Exception Code:    40000015
 Exception Offset:  0007d85a
 OS Version:    6.1.7601.2.1.0.256.48
 Locale ID: 2057
 Additional Information 1:  c89f
 Additional Information 2:  c89f96664d7d2cd53e94623624561d56
 Additional Information 3:  25d2
 Additional Information 4:  25d26db9b8f08829e05b4d3e158d5678

我试过在线搜索,但没有找到解决方案

提前致谢

正如我回答的 .You are using python 3.7. As far as I have tested , modules like pyinstaller and cx_Freeze don't seem to be working in this version. Try uninstalling your python 3.7 (don't forget to backup your files before), and installing python 3.6.3 或除 python 3.7 之外的任何其他 python 3 版本。

编辑:

在评论中,你说windows doesn't throw an error anymore but instead of a GUI window opening a console window opens for a second and then closes。好吧,更改版本有效,但现在您的程序或 pyinstaller 出现问题。您可以使用我的 Python Executable File Maker 让我知道它是否工作正常或抛出任何错误或显示不当行为。