views:

1311

answers:

5

I need to package my python application, its dependencies and python into a single MSI installer. The end result should desirably be:

  • Python is installed in the standard location
  • the package and its dependencies are installed in a separate directory (possibly site-packages)
  • the installation directory should contain the python uncompressed and a standalone executable is not required
+5  A: 

Kind of a dup of this question about how to make a python into an executable.

It boils down to:

py2exe on windows, Freeze on Linux, and py2app on Mac.

pjz
Not really a dup. This is specific to packaging. That other guy has not a clue yet. But cool, that's for the info about py2exe
sims
A: 

py2exe is the best way to do this. It's a bit of a PITA to use, but the end result works very well.

Cody Brocious
A: 

py2exe will make windows executables with python bundled in.

William Keller
+5  A: 

I use PyInstaller (the svn version) to create a stand-alone version of my program that includes Python and all the dependencies. It takes a little fiddling to get it to work right and include everything (as does py2exe and other similar programs, see this question), but then it works very well.

You then need to create an installer. NSIS Works great for that and is free, but it creates .exe files not .msi. If .msi is not necessary, I highly recommend it. Otherwise check out the answers to this question for other options.

dF
A: 

My company uses the free InnoSetup tool. It is a moderately complex program that has tons of flexibility for building installers for windows. I believe that it creates .exe and not .msi files, however. InnoSetup is not python specific but we have created an installer for one of our products that installs python along with dependencies to locations specified by the user at install time.

Mike