pyinstaller打包程序

python打包成exe文件时,用的是pyinstaller

第一步安装pyinstaller

pip install pyinstaller

第二步

pyinstaller -F -w -i ***.ico ***.py

其中 ***.ico 是logo, .py是你要打包的py文件
pyinstaller打包程序_第1张图片
我在打包时出现了struct.error: unpack requires a buffer of 16 bytes
是由于ico文件的问题,通过查找找到了https://lvwenhan.com/convertico/
可以用于转化logo,我的转化成16x16,再重新打包就成功了。
打包之前删除文件 ***.spec

以上是我安装完了PyQt5
我是按照https://blog.csdn.net/zhangziju/article/details/80243858

你可能感兴趣的:(pyinstaller打包程序)