addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [PhillyPUG] question about python executable file

From: Tom P.
Sent on: Monday, November 14, 2011 8:58 PM
> My question is: is the installer or packaging system definitely necessary?  Is p2exe enough by itself?  What will happen if I don't create an installer or packaging system?

So, strictly speaking, creating an installer is not necessary. However, unless your user is also a developer or you don't really need the distribution of your program to appear "professional", I think you would want to. To explain why, I'll speak concretely about py2exe (Windows target), however, I imagine that py2app and freeze have similar issues specific to their respective target platforms.

To start off, py2exe doesn't create a single statically linked binary. It creates a bunch of files. Specifically, it packages up your program files and the executable that the user will launch and also the runtime system as well. This includes the entire python interpreter (as a DLL), any needed standard library modules, other modules, etc. Additionally, there is a really good chance some of the external or standard library modules that your program depends on has its own dependencies on other shared libraries (i.e. DLLs) that are on your development system. py2exe has to package them up too. By creating an installer program, you can tuck all of these files away nicely in a directory somewhere then create a desktop shortcut icon so the user can more easily launch your program. Additionally, you may have other modifications that you need to make to the host system (e.g., edit the registry, set an environment variable, put a config file somewhere, etc.) in order to create a proper runtime environment for your software. Putting all of this in an installer is an easy way to do it without requiring the user to do something they are not used to.

I've only really done this sort of thing for Windows targets because UNIX systems (including Linux and Mac) typically ship with a Python interpreter already installed. So, I can't speak to them directly, but, again, I assume the issues encountered with py2exe on Windows are similar for mac- or unix-based frozen binaries.

Hope that helps.


Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy