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??

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.