py2exe-“缺少以下模块" [英] py2exe - "The following modules appear to be missing"

查看:182
本文介绍了py2exe-“缺少以下模块"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次使用stackoverflow,所以请轻松一些.我以前在旧计算机上使用py2exe,它工作正常.不幸的是,当尝试在我的新exe上使用它时.文件只是不起作用.尝试转换.py文件时出现这些错误.

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.

我的设置.py

from distutils.core import setup
import py2exe

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

我的Test.py转换为exe.

My Test.py to convert to 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

有什么想法吗?我只是放弃了在网上寻找的机会,因为我似乎无法找到问题的任何答案.非常感谢您的帮助.

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.

推荐答案

我认为问题在于您在控制台应用程序中使用的是窗口选项,而不是控制台选项.对于与py2exe有关的任何其他问题,您可以参考此链接.

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.

使用以下代码构建您的.exe:

Use this code to build your .exe:

from distutils.core import setup
import py2exe

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

这篇关于py2exe-“缺少以下模块"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆