Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 811
mad5245 Avatar asked Feb 20 '13 17:02

mad5245


1 Answers

I think pyinstaller is your best bet.. They do happen to have a Python3 version:

py2exe - generate single executable file

https://github.com/pyinstaller/pyinstaller/wiki

pip install https://github.com/pyinstaller/pyinstaller/archive/python3.zip

like image 118
Sohrab T Avatar answered Sep 28 '22 01:09

Sohrab T