10

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.

mad5245
  • 394
  • 3
  • 8
  • 20
  • Some libraries are just not working well with cx_freeze. Run it on their PCs from opened console to see what is the error. – Fenikso Feb 20 '13 at 18:20
  • If you use the `Win32GUI` base ([see the docs](http://cx_freeze.readthedocs.org/en/latest/distutils.html)), the error message should be displayed in a way that you can see. – Thomas K Feb 21 '13 at 13:14
  • what system do your cooworkers use ? I use linux, and windows with same configuration for my application (python 3.x, pyqt4, cx-freeze) and everything works well. If thread is still alive I can post my cx_freeze file. – lagoru Jun 03 '13 at 11:53

2 Answers2

4

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

Community
  • 1
  • 1
Sohrab T
  • 625
  • 4
  • 14
0

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

tobias47n9e
  • 2,233
  • 3
  • 28
  • 54