How to tell Jenkins to use a particular virtualenv python
jenkins, jenkins-plugins, python, python-2.7, virtualenv
Solution
You should install one of python plugins. I've used ShiningPanda. Then you'll be able to create separate virtual environment configurations in Manage Jenkins > Configure System > Python > Python installation. In job configuration there will be Python Builder step, where you can select python environment.
Just make sure you're not starting Jenkins service from within existing python virtual environment.
Problem
I have already created a virtualenv for running my python script. Now when I integrate this python scrip with Jenkins, I have found at the time execution Jenkins is using wrong python environment. How I can ensure Jenkins is using the correct virtualenv? As an example, for my case I want to use virtualenv test. How I can use this pre-prepared virtualenv to run my python script. ``` source test/bin/activate ```