ninia / jep

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

Automating virtual environments #397

Open audetto opened 2 years ago

audetto commented 2 years ago

I am running jep 4.0.3 in Ubuntu 20.04.

I am already able to use virtual environments, but I feel I am providing redundant information which jep could figure out by itself.

What I do is

  1. set the env var VIRTUAL_ENV before executing java
  2. call MainInterpreter.setJepLibraryPath() with the equivalent of

$VIRTUAL_ENV\lib\python3.8\site-packages\jep\libjep.so

I wonder if this logic cold be automated in https://github.com/ninia/jep/blob/master/src/main/java/jep/LibraryLocator.java

bsteffensmeier commented 2 years ago

This seems reasonable to me. I have implemented it in #398. Thanks for the idea.

SonarSonic commented 2 years ago

@audetto I'm trying to do the same on Windows but those two steps are not enough for me. I'm wondering do you perform additional steps to get your Virtual Environment to work? Thanks!