The build_exe options

Arguments to specific cx_Freeze operations can be passed into setup() using the options argument. This argument takes a dict object where each item is a cx_Freeze operation paired with a dict object of operation-specific arguments. The first operation we're going to look as is build_exe, which is a universal first step for all other operations. As the name implies, this is the stage where the executable and its accompanying files are built.

Among other things, this is where we specify the package dependencies:

    options={
        'build_exe': {
            'packages': ['psycopg2', 'requests', 'matplotlib', 'numpy'],
            'includes': ['idna.idnadata', 'zlib'],

In the preceding code snippet, packages is a list of the packages that need to be installed ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.