Windows下用py2exe将Python程序打包成exe程序的教程
py2exe在sourceforge的下载只支持到2.7。
针对python3.0+的版本,需要自己编译。
1.下载源码
svncheckoutsvn://svn.code.sf.net/p/py2exe/svn/trunkpy2exe-svn
2.编译环境
这里使用的是vs2014.
3.安装
进入py2exe-3
pythonsetup.pyinstall
这里会进行编译、安装。
此外,python默认使用的是vs9,针对vs2014,需要改下文件:
Lib\distutils\msvc9compiler.py
寻找:
VERSION=get_build_version()
在下面增加:
VERSION=11.0
如果出现错误:
Failedtoloadandparsethemanifest.Thesystemcannotfindthefilespecified.
error:command'mt.exe'failedwithexitstatus31