title: Setting up a specific Python in Jenkins
body: <p>I am quite new with configuring Jenkins or Python but I have to set up a unitary test in Jenkins. My program is in Python, but only works on Python 2.6 whereas the Jenkins version I should be using is 2.7, so I'm trying to set up Jenkins to set some environment variables so that it prepares launching the accurate Python for that specific test (it is part of a greater project that will successfully run several other tests that work well).</p>
  
  <p>The idea I had was to set in the command to execute several environment variables like PATH, LD_LIBRARY_PATH and PYTHONPATH such as following in the "Execute shell" command line interpreter:</p>
  
  <pre><code>PYTHONPATH=/path/to/python2.6/lib:$PYTHONPATH
  PATH=/path/to/python2.6/bin:$PATH
  LD_LIBRARY_PATH=/path/to/python2.6/lib:$LD_LIBRARY_PATH
  </code></pre>
  
  <p>... however, it was still calling the wrong version of Python. Therefore, I forced these variables to:</p>
  
  <pre><code>PYTHONPATH=/path/to/python2.6/lib
  PATH=/path/to/python2.6/bin
  LD_LIBRARY_PATH=/path/to/python2.6/lib
  </code></pre>
  
  <p>... and I still get errors because the old version of Python is called instead, even if it should not appear in the PATH ... It appears Jenkins will remember the location of the old libraries however and will try loading them first.</p>
  
  <p>How would I correctly set the environment in a "subproject" in Jenkins so that I can call a different version of Python?</p>
  
  <p>Thank you and best regards,</p>
  
  <p>~Stéphane</p>