关于py2exe打包的问题,如果谁能解决,愿意外包给在深圳的高手,价格面议。

seafish1119 2009-03-10 09:20:48
小弟最近接了一个任务,做了一个数据分析工具,用python编写,中间用到了Tkinter图形界面模块和matplotlib模块,但是打包的问题一直没有解决,用py2exe老是报很多模块缺失。下面是详细的错误信息。谁能解决,我愿意出一个合适的价格外包给在深圳的IT工作者,价格面议。
The following modules appear to be missing
['IronPythonConsole', 'Numeric', 'StdSuites.Standard_Suite', 'System', 'System.W
indows.Forms.Clipboard', '_curses', '_imaging_gif', '_transforms', 'aetools', 'c
lr', 'config', 'core.abs', 'core.max', 'core.min', 'core.round', 'email.Generato
r', 'email.Iterators', 'email.Utils', 'email.base64MIME', 'fcompiler.FCompiler',
'fcompiler.show_fcompilers', 'lib.add_newdoc', 'ltihooks', 'modes.editingmodes'
, 'mpl_toolkits.natgrid', 'numarray', 'numscons', 'numscons.core.utils', 'projec
tions.get_projection_class', 'projections.get_projection_names', 'projections.pr
ojection_factory', 'pyemf', 'pytz.zoneinfo', 'qt', 'startup', 'testing.Tester',
'win32com.gen_py', 'numpy.absolute', 'numpy.arccos', 'numpy.arccosh', 'numpy.arc
sin', 'numpy.arcsinh', 'numpy.arctan', 'numpy.arctanh', 'numpy.bitwise_and', 'nu
mpy.bitwise_or', 'numpy.bitwise_xor', 'numpy.bool_', 'numpy.ceil', 'numpy.comple
x_', 'numpy.conjugate', 'numpy.core.add', 'numpy.core.cdouble', 'numpy.core.comp
lexfloating', 'numpy.core.conjugate', 'numpy.core.csingle', 'numpy.core.double',
'numpy.core.float64', 'numpy.core.inexact', 'numpy.core.intc', 'numpy.core.isfi
nite', 'numpy.core.isnan', 'numpy.core.maximum', 'numpy.core.multiply', 'numpy.c
ore.single', 'numpy.core.sqrt', 'numpy.cosh', 'numpy.divide', 'numpy.fabs', 'num
py.float_', 'numpy.floor', 'numpy.floor_divide', 'numpy.fmod', 'numpy.greater',
'numpy.hypot', 'numpy.int_', 'numpy.invert', 'numpy.isinf', 'numpy.left_shift',
'numpy.less', 'numpy.log', 'numpy.logical_and', 'numpy.logical_not', 'numpy.logi
cal_or', 'numpy.logical_xor', 'numpy.maximum', 'numpy.minimum', 'numpy.negative'
, 'numpy.not_equal', 'numpy.power', 'numpy.random.rand', 'numpy.random.randn', '
numpy.remainder', 'numpy.right_shift', 'numpy.sign', 'numpy.sinh', 'numpy.tan',
'numpy.tanh', 'numpy.true_divide']
...全文
421 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
nietsche 2009-10-09
  • 打赏
  • 举报
回复
1,你是使用Ironpython作为自己的开发环境?
2,使用py2exe并不能包含所有的模块或是.dll之类的文件,如果不是很清楚,建议使用pyintaller,可能相对而言不用在乎模块是否包含与否!
mrshelly 2009-09-30
  • 打赏
  • 举报
回复
没遇到过...
我一般都是手工再修正的....
thy38 2009-09-30
  • 打赏
  • 举报
回复
收藏了,没准以后自己要用到。
XDF19851117 2009-09-30
  • 打赏
  • 举报
回复
好,有用,多谢!
jscn123789abc 2009-03-20
  • 打赏
  • 举报
回复
ding...
海楓 2009-03-10
  • 打赏
  • 举报
回复
兄弟,少太多的模塊了,可能是路徑沒設好。
建議在win下的path加入python路徑和相應模塊的路徑試試。
Semigod 2009-03-10
  • 打赏
  • 举报
回复
为啥非要是深圳的呢
snipejob 2009-03-10
  • 打赏
  • 举报
回复
# coding: utf-8

from distutils.core import setup
import py2exe
import sys


#deal with some case after packing, such as run with error "LookupError: unknown encoding: utf-8"
includes = ["encodings", "encodings.*", "dbhash", "email.mime.*", "email.*"]
excludes = []


class Target:
def __init__(self, **kw):
self.__dict__.update(kw)
# for the versioninfo resources
self.version = "1.0"
self.company_name = "GxLucent"
self.copyright = "gyzhang"
self.name = "ddc update"

#Put content in *.exe.manifest here, the key to resolve XP sytle after pack
manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="*.*.*" type="win32" />
<description>*</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
'''
RT_MANIFEST = 24
#detail setting about the target program.
Main = Target(
# The first three parameters are not required, if at least a
# 'version' is given, then a versioninfo resource is built from
# them and added to the executables.
version = "0.1",
description = "ddc update",
name = "CMmTarget",
# what to build, script equals your program's file name
script = "MainFrame.py",
other_resources = [(RT_MANIFEST, 1, manifest_template)],
#icon.ico is the target program's icon
icon_resources = [(1, r"pic/Downloads.ico")],
#target exe file name is FileSynchronizer here
dest_base = "ddcupdator"
)


# pack the FileSynchronizer
setup(
options = {
"py2exe": { # typelib for WMI
"typelibs": [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)],
# create a compressed zip archive
"compressed": 1,
"optimize": 2,
"ascii": 1,
"bundle_files": 1,
"includes": includes,
"excludes": excludes
}
},
# The lib directory contains everything except the executables and the python dll.
# Can include a subdirectory name.
zipfile = None,
#remove the DOS window when run the program, replace "console" with "windows"
windows = [Main],
#all file list below will be include in the pack folder.
#data_files=[("", ["icon", ]),]
)


照着上面这个示例改改你的setup.py, 应该可以解决你描述的问题
snipejob 2009-03-10
  • 打赏
  • 举报
回复
用py2exe打包程序的时候, exe文件里面不会包含所有代码里面用到过的模块, 需要在setup.py文件里面指明需要include的模块

37,741

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧