ninia / jep

Embed Python in Java
Other
1.3k stars 147 forks source link

Possibility of loading specific python version #431

Closed carlosuc3m closed 1 year ago

carlosuc3m commented 1 year ago

Describe the problem Hello, I am trying to use JEP with different Python distributions. For that I configure the PyConfig object with different Python distributions. In Windows it works perfectly. However for Linux i am finding it a little bit complicated.

My Python distributions are stored in the folder /usr/lib. There I have /usr/lib/python3.9, /usr/lib/python3.8 and /usr/lib/python3.10. Due to the files that JEP searches I need to provide the directory "/usr" so Jep can work. This issue does not allow me to select the wanted Python version. Is there any way to fix this issue?

Environment (please complete the following information):

regards, Carlos

bsteffensmeier commented 1 year ago

You may be able to load a specific version by using MainInterpreter.setJepLibraryPath() to ensure the jep library is loaded from the specific python install that you want to use.

carlosuc3m commented 1 year ago

Great I ve tried it and it works