[Python-Dev] Single-file Python executables (was: Computed Goto dispatch for Python 2)
chris.barker at noaa.gov
Thu May 28 21:24:28 CEST 2015
OK, I'm really confused here:
1) what the heck is so special about go all of a sudden? People have been
writing and deploying single file executables built with C and ++, and
whatever else? forever. (and indeed, it was a big sticking point for me
when I introduced python in my organization)
2) Why the sudden interest in this as core a Python issue? I've been using
Python for desktop apps, on primarily Windows and the Mac for years -- and
had to deal with py2exe, py2app, etc. forever. And it has been a very very
common question on the various mailing lists for ages: how do I deploy
this? how do I make it easy to install? The answer from the developers of
cPython itself has always been that that's a third party problem -- and go
look for py2exe and friends to solve it. And that it is a solved-enough
problem. The biggest "unsolved" issues are that you get a really big
Don't get me wrong -- I've wanted for years for it to be easier to deploy
python-based apps as a single thinking for users to easily install and
uninstall where they don't need to know it's python -- but what the heck is
3) There was mention of a platform-neutral way to do this. Isn't that
simply impossible? The platforms are different in all the ways that matter
for this problem: both technical differences, and conventions. Which isn't
to say you couldn't have one API to produce a single "thing" executable, so
it would look like one solution for multiple platforms to the user. But the
end product should be (would have to be) a different beast altogether.
And doesn't PyInstaller already provide that (may it can't do
Anyway -- if there really is a new interest in this problem such that
people will put some time into, here are some thoughts I've had for ages:
The big one is Separation of concerns: in order to build a single "thing"
executable, you need three things:
a) An API to for the developer to specify what they want
b) Figure out what needs to be included -- what extra modules, etc.
c) A way to package it all up: App bundle on the Mac, single file
executable on Windows (statically linked? zip file, ???)
That third one -- (c) is inherently platform dependent -- and there "is
more than one way to do it" even on one platform. But it sure would be nice
if the API between a) b), and c) could be unified so we could mix and
match different implementations.
And, of course, if cPython itself could be built in a way that makes
step(c) easier/less kludgy great!
On Thu, May 28, 2015 at 9:54 AM, Donald Stufft <donald at stufft.io> wrote:
> On May 28, 2015 at 12:24:42 PM, Chris Barker (chris.barker at noaa.gov)
> > I'm confused:
> > Doesn't py2exe (optionally) create a single file executable?
> > And py2app on the Mac creates an application bundle, but that is
> > more-or-less the equivalent on OS-X (you may not even be able to have a
> > single file executable that can access the Window Manager, for instance)
> > Depending on what extra packages you need, py2exe's single file doesn't
> > always work, but last I tried, it worked for a fair bit (I think all of
> > stdlib).
> > I don't know what PyInstaller or others create. And I have no idea if
> > is a linux option -- but it seems like the standard of practice for an
> > application for linux is a bunch of files scattered over the system
> > :-)
> > Yes, the resulting exe is pretty big, but it does try to include only
> > modules and packages that are used, and that kind of optimization could
> > improved in any case.
> > So is something different being asked for here?
> All of those solutions “work” to varying degrees of work, almost all of
> them rely
> on hacks in order to make things “work” because the ability to do it isn’t
> into Python itself. If the critical pieces to execute in this way was
> built into
> Python itself, then those tools would work a whole lot better than they
> > Barry Warsaw wrote:
> > >> I do think single-file executables are an important piece to Python's
> > competitiveness.
> > Really? It seems to me that desktop development is dying. What are the
> > critical use-cases for a single file executable?
> The desktop isn’t dying, Mobile is becoming a very important thing of
> but that’s just because people are using devices *more* to account for the
> use of Mobile, they aren’t really using their Desktop’s less.
> > And I'd note that getting a good way to use Python to develop for iOS,
> > Android, and Mobile Windows is FAR more critical! -- maybe that's the
> > problem ?
> It’s not the same problem, but it’s also not very relevant. Volunteer time
> fungible, you get what people are willing to work on regardless of whether
> will help Python as a whole. It’s also not an either/or proposition, we
> can both
> improve our ability to develop under iOS/Android/etc and improve our
> ability to
> handle desktop applications.
> Donald Stufft
> PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
Christopher Barker, Ph.D.
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev