1

我有一个创建 GUI 的 .py 文件,一旦我给它一些信息,它就会运行另一个脚本。我正在尝试使用 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
4

0 回答 0