code: def parse_requirements(file_name):
      
      requirements = []
      with open(file_name, 'r') as f:
          for line in f:
              if re.match(r'(\s*#)|(\s*$)', line): continue
              if re.match(r'\s*-e\s+', line):
                  requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$',\
                          r'\1', line).strip())
              elif re.match(r'\s*-f\s+', line):
                  pass
              else:
                  requirements.append(line.strip())
      return requirements
docs: from:
          http://cburgmer.posterous.com/pip-requirementstxt-and-setuppy