I have been using jep for some weeks, come back again and cannot get it run again.
Sth i changed and i cannot find out what it is.
Maybe
First i must say that i run jep in a conda environment.
The problem to get jep to find libjep i solved by passing the CONDA_PREFIX
which is
```
/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3
```
as a property to java and load the libjep with the following code:
```
String pythonInst = System.getProperty(DIR_PYTHON_INST);
PyConfig pyConfig = new PyConfig().setPythonHome(pythonInst);
try {
MainInterpreter.setInitParams(pyConfig);
SharedInterpreter.setConfig(new JepConfig());
} catch (JepException e) {
throw new IllegalStateException("Jep failed to initialize.");
}
```
Seemingly this works but then an error occurs when invoking
```
Interpreter pyInterp = new SharedInterpreter()
```
the following output pops up:
```
PYTHONHOME = '/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3'
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/bin/python3'
sys.base_prefix = '/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3'
sys.base_exec_prefix = '/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3'
sys.executable = '/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/bin/python3'
sys.prefix = '/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3'
sys.exec_prefix = '/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3'
sys.path = [
'/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/lib/python38.zip',
'/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/lib64/python3.8',
'/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/lib64/python3.8/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007efddc29f700 (most recent call first):
<no Python frame>
```
I am a bit surprised about that because this seems to be the right version of python.
The only thing which is strange:
I would have expected site-modules and no lib64.
In fact, if i run python in the condaenvironment directly,
i obtain another path:
```
['',
'/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/lib/python38.zip',
'/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/lib/python3.8', '
/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/lib/python3.8/lib-dynload',
/home/ernst/.local/lib/python3.8/site-packages',
'/home/ernst/.conda/envs/envForMbedOs5.15.1Py3.8.3/lib/python3.8/site-packages']
```
not talking about details but now the python3.8 site-packages are present as expected.
I have the impression, my python invoked from within java uses fallback modules
from the outer installation... is this possible??