Python PyInstaller Demo

By Dr. Louay Chebib

 

 

 

https://github.com/Netuser-Py/PyInstallerDemo

PyInstaller Demo

  • Install and run Python scripts without installing Python
  • “PyInstaller is a program that freezes (packages) Python programs into stand-alone executables, under Windows, Linux, Mac OS X, FreeBSD, Solaris and AIX. …works with Python 2.7 and 3.3—3.5 …builds smaller executables, …multi-platform [compatible].”

PyInstaller Demo

Easy to Install

  • pip install pyinstaller

 

  • From command prompt:    >pyinstaller myMain.py

PyInstaller Demo

Usage

pyinstaller-script.py [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME]

                             [-p DIR] [--hidden-import MODULENAME]

                             [--additional-hooks-dir HOOKSPATH]

                             [--runtime-hook RUNTIME_HOOKS]

                             [--exclude-module EXCLUDES] [--key KEY] [-d] [-s]

                             [--noupx] [-c] [-w]

                             [-i <FILE.ico or FILE.exe,ID or FILE.icns>]

                             [--version-file FILE] [-m <FILE or XML>]

                             [-r RESOURCE] [--uac-admin] [--uac-uiaccess]

                             [--win-private-assemblies]

                             [--win-no-prefer-redirects]

                             [--osx-bundle-identifier BUNDLE_IDENTIFIER]

                             [--distpath DIR] [--workpath WORKPATH] [-y]

                             [--upx-dir UPX_DIR] [-a] [--clean]

                             [--log-level LEVEL] [--upx UPX]

                             scriptname [scriptname ...]

PyInstaller Demo

Windows Demo with Python 3.5

pyinstaller myMain.py

Copy content of distributable exe and DLLs to your app folder.

…\dist\MyMain\

 run form your app folder on target device

Use the -F option to create a self contained Exec (exe) file. No need to copy DLLs since these are now contained in the distribution Exec file.

 

Note:  Best to delete all before rerun of pyinstaller

Made with Slides.com