ninia / jep

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

Jep is only use in base environment of anaconda, and don't work in virtual environment. #428

Closed wanran-cell closed 1 year ago

wanran-cell commented 1 year ago

Describe the problem I install Jep in anaconda virtual environment, although the installation is shown to be successful, it won't work, error: can't find Jep library. And then if I set PYTHONHOME=D:\ProgramData\Anaconda,there is a error Failed to import the site module.

I want to use Jep in anaconda virtual enviroment ,not base enviroment.But I don't know how to do.

Environment (please complete the following information): Java 1.8,python 3.6;windows10;Anaconda;Jep 4.03;tensorflow 1.14

bsteffensmeier commented 1 year ago

I do not recommend setting PYTHONHOME for virtual environments.

Did you activate the virtual env before starting your java application?

There are some improvements coming in the next release to help jep automatically find libraries in virtual env(https://github.com/ninia/jep/commit/e52b494afe300ea76be00ea52f9d8af953dcf2dc) but you may need to add the directory with the library to your PATH until that release is available.