0

i need to run a python script in java, (using jython standalone jar) but when i run the script i got this error:

ImportError: No module named pytesseract

how can import python library, to run this script??

public class SimpleEmbedded {
public static void main(String []args){

  PythonInterpreter interp = new PythonInterpreter();
  System.out.println("Hello, world from Java");
  interp.execfile("text_rec.py");
  System.out.println("Goodbye ");
  }
}

I add also this piece of code:

interp = new PythonInterpreter(null, new PySystemState());
PySystemState sys = Py.getSystemState();
sys.path.append(new PyString(rootPath));
sys.path.append(new PyString(modulesDir));

what's rootPath and ModulesDir?

Can u help me??

Alfonso
  • 113
  • 9

0 Answers0