Python py2exe-单文件exe tkinter程序未执行

Python py2exe-单文件exe tkinter程序未执行,python,tkinter,py2exe,Python,Tkinter,Py2exe,我使用以下代码来执行我的程序: from distutils. core import * import py2exe,sys,os sys.argv.append('py2exe') setup(options={'py2exe':{bundle_files':1,'compressed':True,'includes':["Tkinter",]}}'windows=['trial.py'],zipfile=None,) 它正在创建单个文件.exe,但未执行。 与bundle_file 3相

我使用以下代码来执行我的程序:

from distutils. core import *
import py2exe,sys,os
sys.argv.append('py2exe')
setup(options={'py2exe':{bundle_files':1,'compressed':True,'includes':["Tkinter",]}}'windows=['trial.py'],zipfile=None,)
它正在创建单个文件
.exe
,但未执行。
bundle_file 3相同的代码(没有单个文件)工作正常

trial.py:

import Tkinter
Tkinter.Tk()
mainloop()

请帮助我为GUI程序创建一个
.exe
文件PyInstaller是一个更简单的选项,可以从控制台使用。只需
pip安装pyinstaller
,输入程序目录,然后
pyinstaller-yourscript.py


当我的机器出现错误时,你说
trial.py
工作正常,这让我很困惑
mainloop()
需要替换为
Tkinter.mainloop()

如何使用?是。我使用的是Tkinter import*。我不知道pyinstaller在我的系统中不工作。我使用的是2.7便携式计算机