py2exe and wx support files - does every executable need them or can they be shared?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

py2exe and wx support files - does every executable need them or can they be shared?

Rufus V. Smith
I've recently started looking into "packaging" wxPython-based programs for distribution.

py2exe works like a champ.

But the executable file ends up larger than 8 Mb  (when compiling to single executable).

Rebuilding with options to keep the dist files separate, I saw in the dist directory
many wx*.pyd and wx*.dll files that are huge.  I assume it's all the wxWindows support.

It seems crazy to duplicate all that code if I have several programs installed on the same
system.   Can they be installed to a shared directory and eliminated from the individual
"builds"?

I expect to look into installers soon. When I use installers, it will probably be acceptable
for all the duplication inside the installation files, but during installation, the installers
should install common files to common directories, so they don't copy out of the installer
file if it would just be redundant.

I can't be the first with this issue, but haven't found a good example using Google.

Thanks.

Rufus








--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: py2exe and wx support files - does every executable need them or can they be shared?

GadgetSteve
On 10/04/14 04:10, Rufus wrote:
I've recently started looking into "packaging" wxPython-based programs for distribution.

py2exe works like a champ.

But the executable file ends up larger than 8 Mb  (when compiling to single executable).

Rebuilding with options to keep the dist files separate, I saw in the dist directory
many wx*.pyd and wx*.dll files that are huge.  I assume it's all the wxWindows support.

It seems crazy to duplicate all that code if I have several programs installed on the same
system.   Can they be installed to a shared directory and eliminated from the individual
"builds"?

I expect to look into installers soon. When I use installers, it will probably be acceptable
for all the duplication inside the installation files, but during installation, the installers
should install common files to common directories, so they don't copy out of the installer
file if it would just be redundant.

I can't be the first with this issue, but haven't found a good example using Google.

Thanks.

Rufus

Rufus,

The solution that we use is to use the shared library approach of py2exe and specify a name other than .zip for the library name, to stop the users unzipping the library, this works nicely if you have the library file in the same directory as multiple .exe files but be careful trying to put the shared library elsewhere.  The reason that this can be a problem is that all but a very small stub ends up in the library and overwriting the shared library, possibly because your user needs to use a different version of one of your programs can result in all of your programs changing version, see DLL Hell for the problems MicroSoft have had with a similar issue. 

One other option would be to put all your wx files, (and only the wx files), into a zip file named for the wx version that you are usung and add that file, possibly in a common location, to your sys.path in your programs.  Python will happily import modules from zip files.  You could then exclude wx from the py2exe and have your wxN_M.zip as a required data file.  You could also have a post install step that copies the wx file to a common location if it isn't there already. 

You could also consider building and distributing a wxN_M.egg as an alternative.

PyInstaller is also well worth a look.

Hope that is some help.

Gadget/Steve

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: py2exe and wx support files - does every executable need them or can they be shared?

Tim Roberts
In reply to this post by Rufus V. Smith
Rufus wrote:

> I've recently started looking into "packaging" wxPython-based programs
> for distribution.
>
> py2exe works like a champ.
>
> But the executable file ends up larger than 8 Mb  (when compiling to
> single executable).
> ...
> It seems crazy to duplicate all that code if I have several programs
> installed on the same
> system.

A terabyte disk can be had for $60.  At that price, 8 MB of disk space
costs $ 0.0005.  Seriously, it's not worth the time you've already spent
thinking about this.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: py2exe and wx support files - does every executable need them or can they be shared?

Rufus V. Smith
On 4/10/2014 12:24 PM, Tim Roberts wrote:

> Rufus wrote:
>> I've recently started looking into "packaging" wxPython-based programs
>> for distribution.
>>
>> py2exe works like a champ.
>>
>> But the executable file ends up larger than 8 Mb  (when compiling to
>> single executable).
>> ...
>> It seems crazy to duplicate all that code if I have several programs
>> installed on the same
>> system.
> A terabyte disk can be had for $60.  At that price, 8 MB of disk space
> costs $ 0.0005.  Seriously, it's not worth the time you've already spent
> thinking about this.
>

Sorry, I'm an old guy who once carried around programs on punched paper
tape.

I used to download software from BBSs at 300 baud.

I'll have to change my name to Dino.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: py2exe and wx support files - does every executable need them or can they be shared?

Chris Barker - NOAA Federal
On Thu, Apr 10, 2014 at 10:34 AM, Rufus Smith <[hidden email]> wrote:
On 4/10/2014 12:24 PM, Tim Roberts wrote:
A terabyte disk can be had for $60.  At that price, 8 MB of disk space
costs $ 0.0005.  Seriously, it's not worth the time you've already spent
thinking about this.
Sorry, I'm an old guy who once carried around programs on punched paper tape.

I used to download software from BBSs at 300 baud.

I'll have to change my name to Dino.


yeah, it does feel ugly to have repeated stuff around, but Tim's right -- not only is it not worth the effort, but if you do do it, you'll have a much harder to support an maintain system -- teh term "dll hell" exists for a reason -- it's probably a lot easier for your users if they can upgrade one of your applets without it breaking any others. And managing that can get ugly if they are sharing dlls

-CHB



--

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

[hidden email]

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: py2exe and wx support files - does every executable need them or can they be shared?

Robin Dunn
In reply to this post by Tim Roberts
Tim Roberts wrote:

> Rufus wrote:
>> I've recently started looking into "packaging" wxPython-based programs
>> for distribution.
>>
>> py2exe works like a champ.
>>
>> But the executable file ends up larger than 8 Mb  (when compiling to
>> single executable).
>> ...
>> It seems crazy to duplicate all that code if I have several programs
>> installed on the same
>> system.
>
> A terabyte disk can be had for $60.  At that price, 8 MB of disk space
> costs $ 0.0005.  Seriously, it's not worth the time you've already spent
> thinking about this.
>

I remember when getting a disk at $1 per megabyte seemed like a crazy
good deal.  Some time before that I bought a _used_ 40M hard drive for
something like $125.  It was put into a system which previously had only
a floppy drive, so even that price seemed like a crazy good deal at the
time.


--
Robin Dunn
Software Craftsman
http://wxPython.org

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.