使用py2exe从python GUI创建可执行文件

时间:2013-06-03 18:42:33

标签: python py2exe

我有一个.py文件,可以创建一个GUI,一旦我给它一些信息,它就会运行另一个脚本。我正在尝试使用py2exe从这个GUI文件制作一个.exe文件,但我遇到了麻烦。

Exception: Seems not to be an exe-file

如果有任何有py2exe经验并且之前遇到此消息的人,你能解释一下为什么它不起作用,我能做些什么来修复它?提前谢谢。

编辑:我的setup.py看起来像这样:

from distutils.core import setup
import py2exe

setup(console=['test_gui.py'])

我通过命令提示符运行此代码,如下所示:

python setup.py py2exe

回溯如下:

Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    setup(console=['test_gui.py'])
  File "C:\Python26\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "C:\Python26\Lib\site-packages\py2exe\build_exe.py", line 243, in run
    self._run()
  File "C:\Python26\Lib\site-packages\py2exe\build_exe.py", line 305, in _run
    dlls = self.find_dlls(extensions)
  File "C:\Python26\Lib\site-packages\py2exe\build_exe.py", line 389, in find_dlls
    self.dll_excludes)
  File "C:\Python26\Lib\site-packages\py2exe\build_exe.py", line 1064, in find_d
    ependend_dlls
    bin_depends(loadpath, images + [sys.executable], excludes_use)
  File "C:\Python26\Lib\site-packages\py2exe\build_exe.py", line 1441, in bin_de
    pends
    if isSystemDLL(dll):
  File "C:\Python26\Lib\site-packages\py2exe\build_exe.py", line 1498, in isSyst
    emDLL
    raise Exception, "Seems not to be an exe-file"
Exception: Seems not to be an exe-file

0 个答案:

没有答案