PyQt5(七)打包成exe
我们通过pyInstaller来实现PyQt5打包
打包命令格式:
pyinstaller [选项] 文件名
选项:
首先我们需要打开安装好pyInstaller的虚拟环境,并且进入到该py文件所在的文件夹。然后进行操作。
1.动态库形式打包exe程序并指定应用程序图标:
pyinstaller -D -w -i=logo.ico test.py
2.静态形式打包成一个单独的exe程序并指定应用程序图标:
pyinstaller -F -w -i=logo.ico test.py
可能会出现的问题:
错误问题:The 'typing' package is an obsolete backport of a standard library package and is incompatible with PyInstaller.
我们只需要删除'typing'包就好了,输入以下代码:
pip uninstall typing
本文是《从零开始学PyQt5》第七篇,希望小伙伴们可以多多支持,一起学习!
参考:
来源:Yunlord