Sami Hangaslammi wrote:
> I'd still like to hear why the original poster found PyPack > unsuitable, (so that I could improve it), since it, for example, gets > around both of the numpy/Numeric problems posted by Brian.
Partly because it apparently didn't like having an entry script somewhere other than the root directory (although I didn't fiddle around with this much so I could easily be missing something), but mostly because I didn't think the method of tracing execution to find imports was robust, in particular if you have dynamic imports. In retrospect I bet py2exe doesn't handle this either, so I'll give Pypack another try.
Your reasoning is totally backwards.
py2exe (and just about everything else) uses a less robust way of tracking imports -- it examines bytecode, which will never find dynamic imports. Tracing execution will generally find all imports, so long as your code isn't pathologically dynamic.
Analyzing bytecode is completely safe, automatable, deterministic, and relatively fast.. where running an application to see what it does is generally none of those things. That's why py2exe and related tools generally default to using bytecode analysis despite it being flawed in pathological cases. py2app has built-in workarounds for known pathological cases in the stdlib and many popular libraries, but I don't know if anything like that exists in py2exe yet.
-bob