2. 下载这 个文件, 安装之
3. 打开Gui2Exe, 配置好文件路径,exe类型等之后点击【Compile】
4. 编译后会自动生成build和dist两个文件夹,生成的exe文件在dist文件夹中,build文件夹中是中间文件,现在就没有用了。5. 把dist文件夹ctrl+c/v到目标机器上即可执行exe了
-----------------------------------------
可 能遇到的问题:
1. 编译的时候报错:
DeprecationWarning: the sets module is deprecated import sets
解决方法:
修改 C:\Python26\lib\site-packages\py2exe\build_exe.py
中的 import sets 为 #import sets;
然后全文替换 sets.Set() 为 set();
2. 执行exe的时候报错:
This application has failed to start because the
application configuration is incorrect 。。。
这个错误是因为目标机器上的C Runtime Lib没有正确安装,可以到MS的官网上下载,安装后即可正常运行exe.也可以单独下载MSVCP90.DLL
并拷贝到Python26/DLLs 目录下
参考:
http://blog.csdn.net/ablo_zhou/archive/2010/02/07/5295750.aspx
http://www.cnblogs.com/rickiedu/archive/2009/08/06/1540544.html