| Store | Cart

Re: [Python-Dev] Single-file Python executables (was: Computed Goto dispatch for Python 2)

From: Chris Barker <chri...@noaa.gov>
Thu, 28 May 2015 11:11:36 -0700
On Thu, May 28, 2015 at 10:32 AM, Ryan Gonzalez <rym...@gmail.com> wrote:

> py2exe tends to invoke DLL hell if you have various versions of VS or> Office or both installed. Because Windows.>

uh, yes -- Windows applications invoke dll hell......nothign to be done
about that!

-Chris


>> On May 28, 2015 11:23:57 AM CDT, Chris Barker <chri...@noaa.gov>> wrote:>>> 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 the>> stdlib).>>>> I don't know what PyInstaller or others create. And I have no idea if>> there 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>> anyway :-)>>>> Yes, the resulting exe is pretty big, but it does try to include only>> those modules and packages that are used, and that kind of optimization>> could be improved in any case.>>>> So is something different being asked for here?>>>> Barry Warsaw wrote:>> >> I do think single-file executables are an important piece to Python's long-term>> competitiveness.>>>> Really? It seems to me that desktop development is dying. What are the>> critical use-cases for a single file executable?>>>> 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 same>> problem ?>>>> -Chris>>>>>> On Thu, May 28, 2015 at 8:39 AM, Donald Stufft <don...@stufft.io> wrote:>>>>>>>>>>> On May 28, 2015 at 11:30:37 AM, Steve Dower (stev...@microsoft.com)>>> wrote:>>> > Donald Stufft wrote:>>> > > Well Python 3.4.3 binary is 4kb for me, so you'd have that + your>>> 1KB Python script + whatever>>> > other pieces you need.>>> >>>> > For contrast, here are the things you need on Windows to be able to>>> get to an interactive>>> > prompt (I don't know how other platforms get this down to 4KB...):>>> >>>> > * python.exe (or some equivalent launcher) 39KB>>> > * python35.dll 3,788KB>>> > * vcruntime140.dll 87KB (the rest of the CRT is about 1MB, but is not>>> redistributable>>> > so doesn't count here)>>> > * 26 files in Lib 343KB>>> >>>> > This gets you to ">>>", and basically everything after that is going>>> to fail for some reason.>>> > That's an unavoidable 4,257KB.>>> >>>> > The rest of the stdlib adds another ~16MB once you exclude the test>>> suite, so a fully functioning>>> > Python is not cheap. (Using compressed .pyc's in a zip file can make a>>> big difference here>>> > though, assuming you're willing to trade CPU for HDD.)>>> >>>> > Cheers,>>> > Steve>>> >>>> >>>>>>> You don’t need a "fully functioning Python" for a single file binary,>>> you only>>> need enough to actually run your application. For example, if you're>>> making>>> an application that can download files over HTTP, you don't need to>>> include>>> parts of the stdlib like xmlrpc, pickle, shelve, marshall, sqlite, csv,>>> email,>>> mailcap, mailbox, imaplib, nntplib, etc.>>>>>> Of course deciding which pieces you include in the zip file you're>>> appending>>> to the end of Python is up to whatever tool builds this executable which>>> doesn't need to be part of Python itself. If Python itself gained the>>> ability>>> to operate in that manner than third party tools could handle trying to>>> do the>>> optimizations where it only includes the things it actually needs in the>>> stdlib>>> and excludes things it doesn't. The key thing here is that since you're>>> doing>>> a single file binary, you don't need to have a Python which is suitable>>> to>>> execute random Python code, you only need one that is suitable to>>> execute this>>> particular code so you can specialize what that includes.>>>>>> --->>> Donald Stufft>>> PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA>>>>>>>>> _______________________________________________>>> Python-Dev mailing list>>> Pyth...@python.org>>> https://mail.python.org/mailman/listinfo/python-dev>>> Unsubscribe:>>> https://mail.python.org/mailman/options/python-dev/chris.barker%40noaa.gov>>>>>>>>>>> -->>>> Christopher Barker, Ph.D.>> Oceanographer>>>> 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>>>> Chri...@noaa.gov>>>> ------------------------------>>>> Python-Dev mailing list>> Pyth...@python.org>> https://mail.python.org/mailman/listinfo/python-dev>> Unsubscribe: https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com>>>>> --> Sent from my Android device with K-9 Mail. Please excuse my brevity.>



-- 

Christopher Barker, Ph.D.
Oceanographer

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

Chri...@noaa.gov

_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Steve Dower May 28, 2015 03:30 pm
Donald Stufft May 28, 2015 03:39 pm
Steve Dower May 28, 2015 03:45 pm
Barry Warsaw May 28, 2015 03:58 pm
Paul Moore May 28, 2015 04:38 pm
Wes Turner May 28, 2015 06:03 pm
Steven DAprano May 29, 2015 07:15 am
Donald Stufft May 28, 2015 04:44 pm
Barry Warsaw May 28, 2015 05:25 pm
Terry Reedy May 28, 2015 06:37 pm
M.-A. Lemburg May 28, 2015 06:13 pm
Chris Barker May 28, 2015 04:23 pm
Chris Barker May 28, 2015 04:28 pm
Paul Moore May 28, 2015 04:43 pm
David Cournapeau May 28, 2015 04:44 pm
Chris Angelico May 28, 2015 04:53 pm
Donald Stufft May 28, 2015 05:20 pm
Chris Angelico May 28, 2015 05:43 pm
Steven DAprano May 29, 2015 08:36 am
Paul Moore May 29, 2015 09:38 am
Stephen J. Turnbull May 29, 2015 10:35 am
Donald Stufft May 29, 2015 12:35 pm
Paul Sokolovsky May 29, 2015 02:23 pm
Chris Barker May 30, 2015 03:43 am
Antoine Pitrou May 29, 2015 12:57 pm
Donald Stufft May 28, 2015 04:54 pm
Chris Barker May 28, 2015 07:24 pm
Brett Cannon May 28, 2015 07:47 pm
Paul Moore May 28, 2015 08:29 pm
Terry Reedy May 29, 2015 02:42 pm
Nick Coghlan May 28, 2015 09:08 pm
Steven DAprano May 29, 2015 10:53 am
Paul Sokolovsky May 29, 2015 11:25 am
Brian Curtin May 28, 2015 05:04 pm
Chris Angelico May 28, 2015 05:15 pm
Paul Moore May 28, 2015 05:52 pm
Carl Meyer May 28, 2015 06:07 pm
Donald Stufft May 28, 2015 06:36 pm
Chris Angelico May 28, 2015 06:22 pm
Paul Moore May 28, 2015 07:26 pm
Glenn Linderman May 28, 2015 09:09 pm
Chris Barker May 29, 2015 03:05 am
Paul Moore May 29, 2015 10:33 am
Glenn Linderman May 29, 2015 08:49 pm
Paul Moore May 29, 2015 09:45 pm
Ryan Gonzalez May 29, 2015 09:57 pm
Glenn Linderman May 29, 2015 10:15 pm
Paul Moore May 29, 2015 10:28 pm
Glenn Linderman May 30, 2015 01:03 am
Steve Dower May 29, 2015 10:33 pm
Barry Warsaw May 28, 2015 05:19 pm
Ryan Gonzalez May 28, 2015 05:32 pm
Chris Barker May 28, 2015 06:11 pm
Ryan Gonzalez May 28, 2015 05:40 pm
Messages in this thread