How to bundle a Python application, including dependencies?

I need to package a python application, its dependencies and python in one MSI installer. The end result should be desirable:

  • Python is installed in a standard location
  • the package and its dependencies are installed in a separate directory (possibly on sites)
  • installation directory must contain uncompressed python, and a standalone executable is not required
+48
python packaging tkinter
Sep 20 '08 at 1:39
source share
7 answers

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

It comes down to:

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

+25
Sep 20 '08 at 1:41
source share

I use PyInstaller (svn version) to create a standalone version of my program, which includes Python and all the dependencies. In order to make it work correctly, you need to enable everything (like py2exe and other similar programs, see this question ), but then it works very well.

Then you need to create an installer. NSIS works great for this and is free, but it creates .exe files, not .msi. If .msi is not required, I highly recommend it. Otherwise, check the answers to this question for other parameters.

+16
20 sept '08 at 1:52
source share

My company uses the free InnoSetup tool. This is a moderately complex program that has a ton of flexibility for creating installers for windows. I believe that it creates .exe files, not .msi. InnoSetup is not python specific, but we have created an installer for one of our products that installs python along with dependencies at the locations specified by the user during installation.

+4
Sep 22 '08 at 12:58
source share

I had much better results with dependencies and user folder structures using pyinstaller , and it allows you to find and specify hidden imports and hooks for large dependencies like numpy and scipy. In addition, PITA.

+3
Sep 11 '13 at 7:28
source share

py2exe will make Windows executables with python enabled.

+2
Sep 20 '08 at 1:41
source share

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

+1
Sep 20 '08 at 1:41
source share

Ok, I used py2exe before and it works fine except for one thing ... It only works on Windows executables. Then I found out about Jython, which turns a python script into a .Jar file. This, as you know, is executable from any machine on which Java is installed ("For your latest running version"). This is great because both unix, windows, and ios (in most cases) run java. This means its executable file from all of the following machines. While they run Java. No need to "py2mac + py2exe + freeze" just run on all operating systems. Just jython

For more information on how this works and how you can use it, click here.
http://www.jython.org/

0
Mar 17 '15 at 22:56
source share



All Articles