1、先安装那个打包工具:python -m pip install -i https://pypi.douban.com/simple/ pyinstaller 用豆瓣源/ 2、cmd执行命令:pyinstaller -F -w -i D:\WorkDirectory\NewTestCode\picon.png D:\WorkDirectory\NewTestCode\mytk.py 参数说明:-F指定打包后只生成一个exe格式的文件,i:应用程序的图标 ,-w: 使用windonws窗口模式 3、查找打包后的程序在:Updating manifest in C:\Users\Administrator\dist\mytk.exe
如果出现please install pillow or convert your "png" file to one of (exe,ico) and try again.
说明你没有下载pillow包。在cmd中执行pip install pillow安装包
重新执行pyinstaller -F -w -i D:\WorkDirectory\NewTestCode\picon.png D:\WorkDirectory\NewTestCode\mytk.py

本文指导如何使用Python的PyInstaller工具进行应用打包,包括设置图标和处理Pillow缺失问题。详细步骤包括安装PyInstaller、命令行操作及错误处理。

2858

被折叠的 条评论
为什么被折叠?



