I have a Java application which embeds Jython, by making calls to Python code via the PythonInterpreter class.  Anyhow, my application directory structure looks like...

C:\my_app
    ---> \my_py_code
          ----> person.pyc
    ---> myapp.jar

....therefore I have....

C:\my_app\my_py_code\person.pyc
C:\my_app\myapp.jar

I execute my application by doing...

C:\my_app> java -jar myapp.jar

The Java class which has the main method for the application does the following....

public void static main(String[] args) {

     PythonInterpreter pi = new PythonInterpreter();
     pi.exec("import sys");
     pi.exec("sys.path.append('my_py_code')");   
     pi.exec("import my_py_code");
     pi.exec("from my_py_code import person");
}


When this is executed I get the following error:

ImportError: cannot import name person

ANy ideas how to fix this???

If I try and put a "__init__.py" in the "my_py_code" directory....then the same code fails at the following line:

     pi.exec("import my_py_code");

I am running Jython 2.2a1, Java 5 and python 2.4

Thanks!