Chinaunix

标题: py2exe生成exe文件总是错?setup.py 的问题? [打印本页]

作者: lizi1221    时间: 2006-02-11 16:59
标题: py2exe生成exe文件总是错?setup.py 的问题?
*** 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 编辑 ]
作者: wolfg    时间: 2006-02-12 22:20
把这句
  1. setup(name = "transtool", windows=["a.py"],)
复制代码

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

试试
作者: lizi1221    时间: 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
错误还是存在
作者: wolfg    时间: 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的版本是什么?
作者: sunable    时间: 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"],)
复制代码

另外问一下,怎样打包多文件组成的程序?
作者: KaMakA    时间: 2006-03-18 13:34
这个不是错误啊,系统自带的dll不用也打包的.




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2