py2exe - “The following modules appear to be missing”

匿名 (未验证) 提交于 2019-12-03 09:05:37

问题:

First time using stackoverflow so go easy please. I used py2exe before on my old computer and it worked fine. Unfortunately when trying to use it on my new one the exe. file just doesn't work. I get these errors when trying to convert the .py file.

My setup .py

from distutils.core import setup import py2exe  setup(windows=['Test.py'])

My Test.py to convert to exe.

def Test():    print 'TEST'    Test()

The Errors I receive:

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

Any ideas? I've just gave up looking online because I cant seem to find any answers to the problem. I'd be very grateful for some help.

回答1:

I, think the problem is that you are using the window option rather than the console option for a console application. For any further issues related to py2exe you may refer this Link.

Use this code to build your .exe:

from distutils.core import setup import py2exe  setup(console=['Test.py'])


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!