1、将程序打包成一个exe文件,exe文件位于dist文件夹下:
pyinstaller -F test.py
2、直接按1中打包exe会有调试窗口显示,不显示控制台窗口的打包方式为:
pyinstaller -F --no-console test.py
3、设置应用图标:
pyinstaller -F -i pic.io test.py
4、如果运行exe出现错误no module named xxx,则需要用--hidden-import来指定这个包。
pyinstaller -F test.py --hidden-import xxx