Your Cart

Packaging Python Applications with PyInstaller

On Sale
Added to cart

There is not much fun in creating your own applications if you can't share them with other people!

Whether publishing it commercially or sharing it online, distributing your apps allows other people to benefit from your hard work!

Unfortunately, packaging Python applications can sometimes be hard work.

In this book I walk you step-by-step through the process of packaging your own Python applications. Starting with simple examples and working up to complete installers and signed executables.
You will get the following files:
  • EPUB (4MB)
  • PDF (3MB)
  • ZIP (15MB)

I have been packaging Python applications for years — honestly, it feels longer. This book gives you benefit of that experience & hopefully, saves you from some of the pain.

  • 160+ page ebook of hands-on packaging examples
  • Includes PyQt6, Tkinter, PySimpleGUI, wxPython and Kivy examples in the book
  • Plus PySide2, PySide6 and PyQt5 examples in the source downloads
  • Code free to reuse in your own projects
  • PDF, EPub and Kindle formats
  • Lifetime updates — you get new editions for free.

Basic concepts and first steps

Starting from the very basics of packaging a Python application with examples in PyQt6, Tkinter, wxPython, PySimpleGUI and Kivy. Learn how to customize your application name and add Window icons.

Learn how to Bundle data files

Include data files with your app, from icons to anything else. Learn how to work with relative paths and ensure your apps work on all platforms.

Package 3rd party modules

Learn how to customize packaging for your apps requirements. Including popular 3rd party modules.

Learn how to troubleshoot builds with includes and excludes.

Build native installers on Windows, macOS and Linux

Create platform-native installers on Windows, macOS and Linux, including InstallForge EXE setup, macOS Disk Images and Linux deb packaging.

Includes scriptable examples for Linux and macOS to automate your builds.

About the author

Martin Fitzpatrick is a Python programmer, author and tutor. He's been developing Python/Qt apps for 10 years. Starting out building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice & he's not looked back since.

Table of Contents

  1. Getting Started with PyInstaller p2-20
    • What is PyInstaller?
    • Installing PyInstaller
    • Packaging My first app
  2. Tweaking your build p21-85
    • Naming your application
    • Application Icons
    • Working with Relative paths
    • Data files & Resources
    • Bundling data folders
    • Hidden imports, Excludes & Binaries
  3. Building Installers p86-113
    • Creating Windows Installers (InstallForge)
    • Creating macOS Disk Images
    • Creating Linux Packages with fpm
  4. Signing Executables p114-119
    • Signing Windows Executables (signtool)
    • Signing macOS Application Bundles
  5. Advanced Packaging p120-150
    • Better Relative Paths
    • Detecting the Current Platform
    • Working with command-line arguments
    • Optimizing Packages
    • PyInstaller Hooks
  6. Troubleshooting p151-162
    • Build doesn't complete
    • Built application doesn't run

Frequently Asked Questions