使用pyinstaller打包时生成****.spec文件的一些使用
- 添加隐性依赖的包
- 是否显示控制台
pyinstaller -w ***.py - 打包完成后的图标
pyinstaller -i ‘图片地址’ ‘py文件’
首先生成.spec文件
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['.py'],
pathex=['D:\\wx'],
binaries=[],
datas=[],
hiddenimports=['PySide2.QtXml'], # 缺少隐性以来的包时,填加
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='wx3',