Install PyInstaller from PyPI:
pip install pyinstallerGo to your program’s directory and run:
pyinstaller yourprogram.pyThis will generate the bundle in a subdirectory called dist. Adding -F (or --onefile) parameter will pack everything into single "exe".
pyinstaller -F yourprogram.pyThe --noconsole flag will disable a console opening when excuting the .exe
pyinstaller -F --noconsole yourprogram.pyAdding -F (or --onefile) parameter will pack everything into single "exe" and --noconsole will not show the terminal when running the exe.
pyinstaller -F --paths=<your_path>\Lib\site-packages yourprogram.pyrunning into "ImportError" you might consider side-packages.
pip install pynput==1.6.8still runing in Import-Erorr - try to downgrade pyinstaller - see Getting error when using pynput with pyinstaller
For a more detailed walkthrough, see the manual.
https://pyinstaller.org/en/v4.1/usage.html https://github.com/flatplanet/Tkinter.com-Youtube https://projectgurukul.org/python-qr-code-generator/ https://ttkbootstrap.readthedocs.io/en/version-0.5/
Creating:
python -m venv .venv
MacOs:
source .venv/bin/activate
Windows:
.venv\Scripts\activate
https://github.com/jazzband/pip-tools/?tab=readme-ov-file
python -m pip install pip-tools
to generate requirements.txt use:
pip-compile requirements.inTo update the requirements.txt
pip-compile --upgradeto install dependencies use:
pip-syncor
pip install -r requirements.txt