title: Install Virtualenv without internet connectivity
body: <p>I need to set up a lab environment where the audience may not necessarily have internet connectivity at the venue. There are just a few packages that I need to explain to the audience. </p>
  
  <p>I am trying to make use of virtualenv to do all this. So using pip install I have successfully been able to install virtualenv. After this I activate my virtual env. And then while in there I use pip install again to install the other required modules, like requests etc. </p>
  
  <p>Now since my audience may not have internet connectivity during the training, I want to be able to distribute my virtualenv to them, so that they have a fully working environment and they can just get started with the main content of the training. </p>
  
  <p>I am not sure how to distribute my virtualenv to others. From what I understand, I can do </p>
  
  <blockquote>
    <p>pip freeze > requirements.txt </p>
  </blockquote>
  
  <p>and then</p>
  
  <blockquote>
    <p>pip install -r requirements.txt</p>
  </blockquote>
  
  <p>But the latter above will also need to be done from within a virtualenv to work. Please correct me if I am wrong. </p>
  
  <p>So I tried writing a python script that would automate all of this stuff and given the internet connectivity issue, in my automated script I can not use pip install to install virtualenv. Hence I am instead using setup.py to install virtualenv. </p>
  
  <p>Below is my attempt at the script (which does not work)</p>
  
  <pre><code>import os
  import shutil
  import sys
  from os.path import expanduser
  from os.path import join
  
  home = expanduser("~")
  newpath = join(home,"newFolder")
  print newpath
  if not os.path.exists(newpath):
      os.makedirs(newpath)
  
  cwd = os.path.dirname(os.path.abspath(__file__))
  print cwd
  #virtenv = join(cwd,'virtualenv-13.1.2')
  #print virtenv
  setupFile = join(cwd,'setup.py')
  string = sys.executable + " " + setupFile + " install"
  print string
  os.system(string)
  # isntalling dependencies
  string = "pip install -r requirements.txt"
  os.system(string)
  </code></pre>
  
  <p>The idea is - when the user runs the above script (without any internet), there should be a virtualenv set up in a new folder under his home directory. And then inside that virtual env the script should run pip install -r requirements.txt to install all the required modules. </p>
  
  <p>So far the above script does not do what's needed. And I have placed the above script in the same dir as virtualenv setup files. </p>
  
  <p>Am I even thinking straight ? How can I achieve this ?</p>