title: How to run a python script in virtualenv
body: <p>I have a hello.py file located in "/home/user1/public_html/cgi-bin" that displays the python version:</p>
  
  <pre><code>#!/usr/bin/python
  
  import platform
  
  print "Content-type: text/html\n\n"
  print(platform.python_version())
  </code></pre>
  
  <p>When I go to the url for the script, it displays "2.6.6" in the browser.</p>
  
  <p>I am wanting to use python 3.5 so I had the webhost install a virtualenv in "/home/user1/virtualenv/testproject/"</p>
  
  <p>When I try to change the first line of the code to:</p>
  
  <pre><code>#!/home/user1/virtualenv/testproject/3.5/bin/python
  
  import platform
  
  print "Content-type: text/html\n\n"
  print(platform.python_version())
  </code></pre>
  
  <p>the script will display "It works! Python 3.5.5" which is not what I have coded into the script.</p>
  
  <p>Am I supposed to put the hello.py file into the virtualenv directory?  Or is it that I have the path to the python 3.5 incorrect?  Or am I just totally misunderstanding how all of this works?  Any help would be appreciated.</p>