top band

Who needs exes? Distributing Python apps as Python on Windows

Thomas Kluyver

Audience level:


Pynsist is a new tool for distributing Python applications on Windows. Unlike other tools, it keeps your code as regular Python files and packages, so no special tricks are needed to load data files or run Python subprocesses. Thanks to NSIS, it's also practical to build Windows installers on Linux or Mac.


Having written a desktop application in Python, you want to make it easy for users to install and run it. Most tools designed for this focus on trying to make an executable for your application, and hide as many files as possible, but this approach is brittle: 'frozen' applications often have problems that the same code doesn't have when run normally. [Pynsist]( is a new tool taking a different approach. It creates an installer which first installs the necessary version of Python, then unpacks the application code to regular files and directories, and creates shortcuts to run that application code in Python. Although there is no `myapp.exe`, the result looks and works like a 'real' application. In addition, since NSIS is available on other platforms, the developer can prepare Windows installers from a Linux or Mac computer. Pynsist is an open source project, and it works with recent versions of Python 3, and Python 2.7.
bottom band background