PyInstaller and making a Python program for deployment

http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi

PyInstaller packages Python programs into standard executables, that work on computers without Python installed. It doesn’t automatically create a subfolder structure and put things like images etc in there. That must remain a manual step.

The idea is to give someone a zipped up folder which they can unzip somewhere and it will work. They may not even have python installed, or the same version of python installed.

0. ********************************************

Install pyinstaller!

1. *********************************************

Run the following:

"C:\Python24\Libsite-packages\pyinstaller_1.2\Makespec.py"
--name="myVersion"
--onedir
--windowed
--out="C:\Backup\myVersion\Package"
"C:\Backup\myVersion\myVersionGUI.py"
"backup_classes_no_prompts.py"
"my_data.py"
"myVersion.py"
"myVersion_add_package.py"
"myVersion_package_details.py"
"myVersion_packages_list.py"

The series of scripts at the end is what is put into the executable.

–windowed (Use the Windows subsystem executable, which does not open the console when the program is launched. (Windows only))

(if too long, leave out a file and add it manually into myVersion.spec once made).

The goal is to get:

a = Analysis([os.path.join(HOMEPATH,'support_mountzlib.py'),
os.path.join(HOMEPATH,'supportuseUnicode.py'),
'C:\Backup\myVersion\myVersionGUI.py',
'C:\Backup\myVersion\backup_classes_no_prompts.py',
'C:\Backup\myVersion\my_data.py',
'C:\Backup\myVersion\myVersion.py',
'C:\Backup\myVersion\myVersion_add_package.py',
'C:\Backup\myVersion\myVersion_package_details.py'],
pathex=['C:\Python24\Libsite-packages\pyinstaller_1.2'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=1,
name='buildmyVersion/myVersion.exe',
debug=False,
strip=False,
upx=False,
console=False )
coll = COLLECT( exe,
a.binaries,
strip=False,
upx=False,
name='distmyVersion')

This can be manually edited etc.

2. **********************************************

NB all the syntax MUST be checked first (e.g. in DrPython).

Then:
“C:\Python24\Lib\site-packages\pyinstaller_1.2\Build.py” “C:\Backup\myVersion\Package\myVersion.spec”
3. **********************************************

Then manually add the following to the “distmyVersion” folder:

python_logo_only_39.xpm
python_logo_only_16.xpm

UPDATE: version 1.3 came out in Dec 2006. There is a great article about how to install and use it at: http://www.thescripts.com/forum/thread579554.html

UPDATE: Pyinstaller Round 2

UPDATE: Pyinstaller 1.5 with Python 2.6 (Round 3)