Follow these steps to create a standalone executable from your Python script using PyInstaller.
pip install pyinstaller
cd /path/to/your/script
Replace your_script.py
with your script's filename:
pyinstaller --onefile your_script.py
- The
--onefile
flag bundles everything into a single executable.
After building, the executable will be in the dist
folder:
dist/your_script
./dist/your_script
For more options, see the PyInstaller documentation.