PyInstaller安装
下载地址:http://www.pyinstaller.org/wiki
最新版本:PyInstaller 2.0
直接“解压缩”之后即可使用,解压到您想让他在的路径即可
PyInstaller配置
事先写好py程序
在命令行执行:python Makespec.py --console --onefile NotePad\notepad.py 报错:Configfile is missing or unreadable. Please run Configure.py before building
在命令行执行:Configure.py 报错:Python 2.6+ on Windows support needs pywin32,Please install http://sourceforge.net/projects/pywin32/
安装最新版本的 pywin32-217.win32-py2.7.exe,下载地址:http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/
PyInstaller使用
命令行中运行
目录切换到PyInstaller的安装目录“E:\pyinstaller-1.5\pyinstaller-1.5>”
在PyInstaller的安装目录下新建一个文件夹(比如NotePad), 然后将要转换的py脚本放到文件夹里(notepad.py)
E:\pyinstaller-1.5\pyinstaller-1.5>python Makespec.py --console --onefile NotePad\notepad.py
E:\pyinstaller-1.5\pyinstaller-1.5>python Build.py NotePad\notepad.spec
验证exeE:\pyinstaller-1.5\pyinstaller-1.5> E:\pyinstaller-1.5\pyinstaller-1.5\NotePad\dist\notepad.exe 0 0 100(成功)
查看生成的文件,生成的中间文件spec
查看生成的文件,生成的最终文件exe