Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Some Results from Trying to Cheat py2exe

Thread Tools

Some Results from Trying to Cheat py2exe

Michael Peuser
Posts: n/a
I tried to reduce the size of some binary distribution in removing the
things I could expect on the presumed targets - generally a minimal
installation including Tcl/Tk.

The results are as follows:

(1) It does not seem possible to remove any *.pyd files: py2exe or whoever
wants them in the local directory. sys.path seems not to be used. Even
deleting it altogether has no impact at all.

(2) sys.path, sys.exec_prefix and sys.prefix are set to the local
directory, changes to them also have no visible effect.

(3) Removing DLLs has been more successful. However it is a matter of PATH
setting on the target, where they are found. This seems to be irrelevant for
the interpreter, alas not for tcl and tk.

(4) It seems that Tcl and Tk expect some support data in folders tcl8.3 and
tk8.3 which are expected at ../lib (i.e. one back and in a folder called
lib). This is generally NOT the situation in a standard Python installation
(where they are in ..\tcl) nor is it the case in the local directory of
py2exe (where they are in ./tcl). This is something I do not understand!

(5) Thus if the DLLs are found in a standard Python installation, it will
fail. It is generally not possible to make a safe setup because of
uncontrollable PATH settings.....

(6) Those Tcl/Tk folders are quite large, mostly because of some asiatic
unicode files. Those can safely be deleted I think.

Conclusion: For distributions to customers without Python and unwilling to
do any system changes it would be safest to fill some PYAPP folder with
tcl/tk, the tcl folder and interpreter and maybe wxms24h DLLs. Than just
drop your installations into that folder. This can safely be done when
un-zipping them. The drawback is that there is no strcture at all inside
that folder.

The second best solution would be to put that PYAPP folder anywhere (however
the structure must be changed, because of (4): PYAPP has to contain a DLL
directory and the LIB directory for the tcl/tk folders. the PATH setting
must be done to PYAPP/LIB. Now a reduced distribution can be put anywhere.
This has some advantages from the point of configuration control, however is
bound to break if the user decides to install a full Python.

The situation is a mess and it took me some time to sort out all the
problems (help came from Thomas Heller). So may be it will help someone -
and be it to keep hands off

Michael P

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [Py2exe-users] py2exe 0.6.9 released Chris Spencer Python 3 12-08-2008 05:17 PM
about py2exe, I installed it, but can't find py2exe.exe in my computer. python Python 3 05-22-2006 02:08 PM
To cheat, or not to cheat? Mark MCAD 8 03-24-2006 09:12 PM
Is Pentax trying to cheat? risadler Digital Photography 23 02-24-2006 04:45 AM
[py2exe] py2exe and datetime -> No module named datetime F. GEIGER Python 0 08-16-2004 01:13 PM