简体   繁体   中英

How do I create an all in one exe file from cx_freeze (or installer) from python 3.3

I have made a GUI python script that I would like to share with my coworkers to improve productivity. I need a way to include everything in one file/directory for them to use. I tried the standard

python setup.py build

But it does not contain everything (tested on their pc's and I just get a quick command prompt popup and then it closes.)

It works fine on my machine, but I have other things installed (like python for example)

My setup.py is as follows:

import sys
from cx_Freeze import setup, Executable

executables = [
        Executable("Blah.py")
]

buildOptions = dict(
        compressed = True,
        includes = ["Blah"],
        path = sys.path + ["modules"])

setup(
        name = "Blah",
        version = "0.1",
        description = "Blah",
        options = dict(build_exe = buildOptions),
        executables = executables)

I have spent hours searching already with no luck. I feel like there is a way to include all needed file, I am just not sure how. Any help would be appreciated. Thank you.

You could try pynsist. It is an easy way to bundle Python applications for Windows and it has examples for all kinds of GUI toolkits:

It does not rely on setup.py but on a separate config file that grabs all the necessary dependencies.

Repository: https://github.com/takluyver/pynsist

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM