From: Robert W. B. <rb...@di...> - 2001-10-22 04:02:35
|
Hello Ihab, On Sun, 21 Oct 2001, Ihab A.B. Awad wrote: > > Yet more re this ... sorry for the proliferation of msgs. > > (a) I realized that "no module named java" was because my programs were > not specifying a "python.cachedir" property correctly. Fixing this has > fixed the original problem. Good. > (b) Now, running inside my JSP application (which is where I _really_ want > to use Jython), when I do -- > > import os > dir(os) > > I get the error -- > > ImportError: no module named javaos > > Eek. So, now, does _that_ look familiar to anyone? Yes, os requires the javaos module, and you get the ImportError when that module cannot be Located. Fix= make sure module is found. Check your python.home/sys.path vars. Use PythonInterpreter.initialize before instantiating the interpreter to set properties like python.home so modules can be found. The org.python.util.PyServlet code is the best example of setting properties and the initialize method. -robert |