Python py2exe-“;以下模块似乎缺失;

Python py2exe-“;以下模块似乎缺失;,python,module,exe,py2exe,Python,Module,Exe,Py2exe,第一次使用stackoverflow,请放轻松。我以前在我的旧电脑上使用过py2exe,它工作得很好。不幸的是,当我尝试在新的exe上使用它时。文件就是不起作用。我在尝试转换.py文件时遇到这些错误 我的设置.py from distutils.core import setup import py2exe setup(windows=['Test.py']) 我的Test.py将转换为exe def Test(): print 'TEST' Test() 我收到的错误: Th

第一次使用stackoverflow,请放轻松。我以前在我的旧电脑上使用过py2exe,它工作得很好。不幸的是,当我尝试在新的exe上使用它时。文件就是不起作用。我在尝试转换.py文件时遇到这些错误

我的设置.py

from distutils.core import setup
import py2exe

setup(windows=['Test.py'])
我的Test.py将转换为exe

def Test():
   print 'TEST'
   Test()
我收到的错误:

The following modules appear to be missing

['IronPythonConsole', 'System', 'System.Windows.Forms.Clipboard', '_scproxy', 'c
lr', 'console', 'modes.editingmodes', 'pyreadline.keysyms.make_KeyPress', 'pyrea
dline.keysyms.make_KeyPress_from_keydescr', 'pyreadline.keysyms.make_keyinfo', '
pyreadline.keysyms.make_keysym', 'startup']

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   OLEAUT32.dll - C:\WINDOWS\system32\OLEAUT32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
   ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
   WS2_32.dll - C:\WINDOWS\system32\WS2_32.dll
   GDI32.dll - C:\WINDOWS\system32\GDI32.dll
   VERSION.dll - C:\WINDOWS\system32\VERSION.dll
   ole32.dll - C:\WINDOWS\system32\ole32.dll

有什么想法吗?我已经放弃了上网,因为我似乎找不到任何问题的答案。我非常感谢您的帮助。

我认为问题在于,对于控制台应用程序,您使用的是窗口选项,而不是控制台选项。有关py2exe的任何其他问题,请参阅此

使用以下代码生成.exe:

from distutils.core import setup
import py2exe

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

我只是运行相同的代码,它没有给出任何缺少的模块错误。尝试重新安装py2exe的内容。打印相同的错误,但当我单击Test.exe时,它会弹出,然后立即关闭。@Alex:从控制台运行程序。它会打开和关闭,因为此应用程序没有GUI。但是如果你在控制台中运行它,它会打印“TEST”。