Install PyInstaller
pip install pyinstaller
Generate spec file
pyinstaller --onefile foo.py
Tweak spec file
datas=[("myfile.txt", "."), ("mydb.db", ".") ], hiddenimports=["packaging", "packaging.version", "packaging.specifiers"],
In one-file mode, no COLLECT is called within spec file, so finally there will be only one exe file generated.
Generate one-file exe
pyinstaller foo.spec
No comments:
Post a Comment