py2exe-“以下模块似乎丢失”

2024-05-18 12:24:00 发布

您现在位置:Python中文网/ 问答频道 /正文

第一次使用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

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


Tags: 文件topytestyoumakewindows错误
1条回答
网友
1楼 · 发布于 2024-05-18 12:24:00

我认为问题在于,对于控制台应用程序,您使用的是窗口选项,而不是控制台选项。有关py2exe的任何进一步问题,您可以参考Link

使用此代码生成.exe:

from distutils.core import setup
import py2exe

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

相关问题 更多 >

    热门问题