ninia / jep

Embed Python in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

simonaries opened this issue · comments

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?