From: Robert W. B. <rb...@di...> - 2001-10-27 06:19:20
|
On Fri, 26 Oct 2001 Mat...@i2... wrote: > I have a jar setup containing all of jython/Lib (*.py and all > pre-byte-compiled *$py.class). I pass in a "-Dpython.path=my.jar!Lib", > and imports work fine for all the modules in the main Lib directory (e.g. > glob), but if I try and import something in a nested directory (e.g. > Lib/pawt) I get an ImportError. Any ideas? Thanks, > > Matt I think some additional info would help here. I tried the same setup you mention, and all the pawt modules/classes imported correctly (without ImportError). The trick now is to find out what is different for you. -My setup== jdk1.3.1, Linux, latest cvs jython -all libs (*.py and *.class files) in jyLibs.jar. -used the following command to start Jython: java -Dpython.home=/export/cvs/jython \ -Dpython.path=/export/cvs/jython/jyLibs.jar\!Lib \ -cp /export/cvs/jython/jython.jar:/export/cvs/jython/jyLibs.jar \ org.python.util.jython -v -the following imports work fine (plus other permutations of from pawt import x): import pawt.colors import pawt.GridBag import pawt.swing One guess might be that you have a package that is missing its __init__.py file. -Robert |