IntelliJ Java -- Need Python VirtualEnv Set Up Before Running Java

Answered

Hi,

I want to run/debug a Java program from IntelliJ Ultimate. The issue is that the Java program runs some Python code, and that Python code needs a virtualenv loaded. All I care about is the Java code; I don't want to debug or test the Python code, but if the Java code can't run the Python code, it exits.

From a bash shell, I would do something like this:

source virtualenv/bin/activate
java -cp .... ClassThatInvokesPython.class

If I set up IntellIJ to run/debug ClassThatInvokesPython, it fails at runtime because the virtualenv has not been activated.

Is there a way to have an IntelliJ run configuration that activates the virtualenv, then run/debug the Java program?

I'm a Python newbie, so I might be missing something obvious.

Thanks,

Charles

1 comment
Comment actions Permalink

No, IntelliJ IDEA doesn't have this feature. You can set up environment like PATH manually in the run/debug configuration, though.

1

Please sign in to leave a comment.