ninia / jep

Embed Python in Java
Other
1.28k stars 145 forks source link

Fatal Python error: Py_Initialize: Unable to get the locale encoding #459

Closed simonaries closed 1 year ago

simonaries commented 1 year ago

Hello, I would like to initialize another python interpreter in a python environment using jep in the following way: PyConfig pyConfig = new PyConfig().setPythonHome("/data/anaconda3/envs/gc_klgbight/bin/python"); MainInterpreter.setInitParams(pyConfig); SubInterpreter interp = new SubInterpreter();

But the execution times were wrong: Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings'

Is there anyone who can help me solve this problem?