From: Andrea <mar...@go...> - 2009-03-01 18:55:26
|
Andrea wrote: > > import sys > sys.path.append('/home/andrea/foo/jython/andrea.jar') > import org > t=org.foo.Test() > print t > print t.print() > I've tried import org.foo.Test >>>> ImportError: No module named foo import org.foo >>>> ImportError: No module named foo from org.foo import Test >>>> ImportError: No module named foo But I've discovered that if I use a different name org->com it works. Originally I thought that the first part of the package had to be a new name, but now I have a different view If, at that point (with "org", after the above errors), I do "import xyz" I get >>> import xyz *sys-package-mgr*: processing new jar, '/home/andrea/foo/jython/andrea.jar') Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named xyz And then all my classes have been imported! My best understanding is that some import don't trigger a rescan of all jar, while others do. Is anybody reading all that? |