py2exe 0.66的”zlib not available”问题 Py2exe 0.66 "zlib not available"
一直使用py2exe打包python工程,昨天照往常一样打包准备发布,却发现生成的exe文件不能用了。 Py2exe package has been used python works, as usual yesterday preparing to release a package, but found that generated exe files can not be used.
提示如下: Tips are as follows:
decompress data; zlib not available Decompress data; zlib not available
Traceback (most recent call last): Traceback (most recent call last):
File “bot2.py”, line 8, in ? File "bot2.py", line 8, in?
zipimport.ZipImportError: can’t decompress data; zlib not available Zipimport.ZipImportError: can't decompress data; zlib not available
赶紧google了一番,看来遇到这样问题的不少,但没有很好的解决方法。 Google a lot quickly, it seems that the problems encountered so many, but no good solution.
根据网上的提示,反复尝试,发现只要去掉setup.py中的”compressed”: 1,就可以正常的生成exe文件。 According to online tips and repeated attempts to remove setup.py found as long as the "compressed": 1, we can generate normal exe. 也就是说不能使用文件压缩功能,看了一下,生成的文件比原来大了不少,很是不爽。 That is not the use of file compression functions, read about the formation of the original document than a lot of big, very不爽. 但确乎是找不到什么好的方法了。 But what could not find it to indeed be a good method.
突然想到,最近曾经将py2exe升级为0.66版本,会不会是这个原因呢? Suddenly thought, recently py2exe will be upgraded to version 0.66, this will not be a reason? 于是将其恢复回0.65,发现竟然可以使用原来的setup文件生成压缩的exe文件。 So its back to 0.65 resume found to be able to use the original documents generated compressed setup exe.
看来,升级要谨慎,版本高未必就是东西好。 It seems, to be cautious upgrade, version is not high things good.
刚刚又打包了一个com server的py程序(就是因为这个升的级),发现生成的exe出错了,但使用0.66版本却是正常的。 Also just a pack of py com server process (this is because the level l), that generated exe fault, but the use of version 0.66 is normal. 这该如何是好呢。 This is the what to do.




