py2exe生成exe文件总是错?setup.py 的问题?

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有问题,可是怎么改也不行:(

[Copy to clipboard] [ - ]
CODE:
#a.py
import base64
import zlib
import sys
   

f = file(sys.argv[1], "rb")
lines = f.readlines()
  
f.close()
f = file(sys.argv[2],'w')
start = False
message = ""
f.close

def dealwith(message):

    f.write ("-------------------------------------------------------------\n")
    try:
        f.write(zlib.decompress(base64.b64decode(message)[0x48:]))
    except:
        return
    f.write ("\n-------------------------------------------------------------\n")

for line in lines:
    if "MessageStart" in line:
        start = True
    elif "MessageEnd" in line:
        dealwith(message)
        start = False
        message = ""
    elif start:
        message += line



[Copy to clipboard] [ - ]
CODE:
#seup.py
from distutils.core import setup
import py2exe

setup(name = "transtool", windows=["a.py"],)

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

把这句

[Copy to clipboard] [ - ]
CODE:
setup(name = "transtool", windows=["a.py"],)

改成

[Copy to clipboard] [ - ]
CODE:
setup(name = "transtool", console=["a.py"],)

试试
试了一下,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
错误还是存在


QUOTE:
原帖由 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的版本是什么?
我也有类似的问题

[Copy to clipboard] [ - ]
CODE:
*** 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:\WINNT\system32\ADVAPI32.dll
   WS2_32.dll - C:\WINNT\system32\WS2_32.dll
   USER32.dll - C:\WINNT\system32\USER32.dll
   WSOCK32.dll - C:\WINNT\system32\WSOCK32.dll
   SHELL32.dll - C:\WINNT\system32\SHELL32.dll
   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

[Copy to clipboard] [ - ]
CODE:
from distutils.core import setup
import py2exe

import py2exe
setup(console=["kmailer.py","kinca_pop.py","kinca_smtp.py","kinca_file.py"],)

另外问一下,怎样打包多文件组成的程序?
这个不是错误啊,系统自带的dll不用也打包的.