Executable Python Programs

Duncan Booth duncan at NOSPAMrcp.co.uk
Mon Sep 2 04:47:05 EDT 2002


Gerhard Häring <gerhard.haering at gmx.de> wrote in 
news:mailman.1030908003.28854.python-list at python.org:

> My personal opinion is that py2exe/Installer/etc. are for
> intermediate/advanced Python programmers. The reason is that it's
> sometimes difficult to fix the dependencies manually, if these tools are
> unable to hunt them down automatically for you.

I think you may be overstating the difficulty here. The vast majority of 
programs run through py2exe etc. with no problems at all. I can only think 
ot a couple of times that I have even had to think about the dependencies:

I had a case recently with py2exe was when it found some extra dependencies 
that I didn't want: I was using jabber.py which for not very good reasons 
imports site.py which indirectly imports a whole load of stuff such as 
tkinter. Explicitly excluding site.py fixed this. Admittedly it took me a 
little while to track down which import was the problem. An option to 
py2exe to dump out why it decided to pull in each module would have been 
helpful.

The only time I had trouble with an import that wasn't being found was when 
I used py2exe on a program using PIL. PIL demand loads a lot of converters 
for different graphics formats which was beyond py2exe's capabilities. 
Explicitly importing all the formats I wanted into the main program fixed 
that one.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list