免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5041 | 回复: 5
打印 上一主题 下一主题

py2exe生成exe文件总是错?setup.py 的问题? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-11 16:59 |只看该作者 |倒序浏览
*** 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.

        ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
        USER32.dll - C:\WINDOWS\system32\USER32.dll
        SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
        KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
可是系统里面明明有这些文件

前面怀疑是setup.py有问题,可是怎么改也不行:(


  1. #a.py
  2. import base64
  3. import zlib
  4. import sys
  5.    

  6. f = file(sys.argv[1], "rb")
  7. lines = f.readlines()
  8.   
  9. f.close()
  10. f = file(sys.argv[2],'w')
  11. start = False
  12. message = ""
  13. f.close

  14. def dealwith(message):

  15.     f.write ("-------------------------------------------------------------\n")
  16.     try:
  17.         f.write(zlib.decompress(base64.b64decode(message)[0x48:]))
  18.     except:
  19.         return
  20.     f.write ("\n-------------------------------------------------------------\n")

  21. for line in lines:
  22.     if "MessageStart" in line:
  23.         start = True
  24.     elif "MessageEnd" in line:
  25.         dealwith(message)
  26.         start = False
  27.         message = ""
  28.     elif start:
  29.         message += line
复制代码


  1. #seup.py
  2. from distutils.core import setup
  3. import py2exe

  4. setup(name = "transtool", windows=["a.py"],)
复制代码



哪位大哥再帮我看看?谢谢

[ 本帖最后由 wolfg 于 2006-2-14 16:46 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-02-12 22:20 |只看该作者
把这句
  1. setup(name = "transtool", windows=["a.py"],)
复制代码

改成
  1. setup(name = "transtool", console=["a.py"],)
复制代码

试试

论坛徽章:
0
3 [报告]
发表于 2006-02-14 11:03 |只看该作者
试了一下,exe文件正常生成,开心ing......
可是还是纳闷,
*** 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.

        ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
        USER32.dll - C:\WINDOWS\system32\USER32.dll
        SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
        KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
错误还是存在

论坛徽章:
0
4 [报告]
发表于 2006-02-14 16:49 |只看该作者
原帖由 lizi1221 于 2006-2-14 11:03 发表
试了一下,exe文件正常生成,开心ing......
可是还是纳闷,
*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them ...


错误是在运行py2exe时出现,还是运行生成的exe文件时出现?

我这里运行你的代码没有问题。你的python和py2exe的版本是什么?

论坛徽章:
0
5 [报告]
发表于 2006-03-16 13:29 |只看该作者
我也有类似的问题

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

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

  6.    ADVAPI32.dll - C:\WINNT\system32\ADVAPI32.dll
  7.    WS2_32.dll - C:\WINNT\system32\WS2_32.dll
  8.    USER32.dll - C:\WINNT\system32\USER32.dll
  9.    WSOCK32.dll - C:\WINNT\system32\WSOCK32.dll
  10.    SHELL32.dll - C:\WINNT\system32\SHELL32.dll
  11.    KERNEL32.dll - C:\WINNT\system32\KERNEL32.dll
复制代码

这个是在运行python setup.py py2exe时出现的。
我的Python版本是2.4.2
下载的py2exe是py2exe-0.5.4.win32-py2.4.exe
我的setup.py

  1. from distutils.core import setup
  2. import py2exe

  3. import py2exe
  4. setup(console=["kmailer.py","kinca_pop.py","kinca_smtp.py","kinca_file.py"],)
复制代码

另外问一下,怎样打包多文件组成的程序?

论坛徽章:
0
6 [报告]
发表于 2006-03-18 13:34 |只看该作者
这个不是错误啊,系统自带的dll不用也打包的.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP