如何在win7 64位系统下用pyinstaller打包python代码成exe

如题所述

1.安装
使用PyInstaller需要安装PyWin32。
下载与Python对应的PyInstaller版本, 解压后就算安装好了 。
2.生成exe文件
Python程序的目录为 F:\hello.py
在命令行 中进入pyinstaller所在的目录,运行python pyinstaller.py F:\hello.py
在PyInstaller-2.1目录下,生成文件夹hello
hello目录下有文件
exe文件在dist目录下
如果将python文件复制到 pyinstaller.py 所在目录下,则运行 python pyinstaller.py hello.py
3. pyinstaller的一些参数
(1) -F 制作独立的可执行程序,但是,运行生成的exe文件会包含警告。
温馨提示:答案为网友推荐,仅供参考
相似回答