On Tue, Feb 23, 2010 at 10:24 AM, Craig Swank <[email protected]> wrote:
> I think I found the problem.  I was also able to import rubbish.example, but
> if you install rubbish.anotherexample
> (http://sabeto.homeunix.com/rubbish.anotherexample.tar.bz2) cx_freeze won't
> be able to find it (at least on my system).

I got the same results -- but only when rubbish.example still existed.
It found "rubbish" in "rubbish.example" and then failed to find
"rubbish.anotherexample" in the "rubbish.example" directory. Removing
the original example made the new example work just like the old.
cx_Freeze does not try all of the possibilities -- it simply calls
imp.find_module(). I could modify it to note which path it actually
found it in and (upon error) try again from that path forward in
sys.path -- but this is a contrived example and not too likely to be
found in the wild. You can also specify which path you would like to
use with cx_Freeze and therefore manually remove the bogus path.
Still, I'm not sure if this is your actual problem or if your actual
code makes use of this "feature" or not. Hopefully we're making
progress. :-)

> After poking around finder.py, it looks like a couple of methods assume that
> if there is a '.' in the package name, the package you are importing is the
> child of another package.  For instance, when it tries to find
> zope.component, the method _InternalImportModule looks for a parent module,
> and finds zope.interface, which is not correct.

Hmm, the examples you have provided me so far actually work just fine
-- other than the fact that sometimes there is more than one valid
parent (rubbish in the examples you provided) and you need to iterate
through them. I believe this is a requirement for Python -- in other
words you can't have a module name with a "." in it without the stuff
in front of the dot being a package. If you know otherwise, please
demonstrate with some code!

I have downloaded zope.component and I was wondering if you can
provide me some sample code that I can use to see the problem with
something more likely to be "real". I have not used zope thus far so I
have no clue. :-(

Anthony

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to