def install_requirements(filename, upgrade=False, download_cache=None, allow_external=None, allow_unverified=None, quiet=False, python_cmd='python', pip_cmd='pip', use_sudo=False, user=None, exists_action=None):
 if (allow_external is None):
  allow_external = []
 if (allow_unverified is None):
  allow_unverified = []
 options = []
 if upgrade:
  options.append('--upgrade')
 if download_cache:
  options.append(('--download-cache="%s"' % download_cache))
 for package in allow_external:
  options.append(('--allow-external="%s"' % package))
 for package in allow_unverified:
  options.append(('--allow-unverified="%s"' % package))
 if quiet:
  options.append('--quiet')
 if exists_action:
  options.append(('--exists-action=%s' % exists_action))
 options = ' '.join(options)
 command = ('%(python_cmd)s -m %(pip_cmd)s install %(options)s -r %(filename)s' % locals())
 if use_sudo:
  sudo(command, user=user, pty=False)
 else:
  run(command, pty=False)

def install_requirements ( filename , upgrade = False , download_cache = None , allow_external = None , allow_unverified = None , quiet = False , python_cmd = 'python' , pip_cmd = 'pip' , use_sudo = False , user = None , exists_action = None ) : if ( allow_external is None ) : allow_external = [ ] if ( allow_unverified is None ) : allow_unverified = [ ] options = [ ] if upgrade : options . append ( '--upgrade' ) if download_cache : options . append ( ( '--download-cache="%s"' % download_cache ) ) for package in allow_external : options . append ( ( '--allow-external="%s"' % package ) ) for package in allow_unverified : options . append ( ( '--allow-unverified="%s"' % package ) ) if quiet : options . append ( '--quiet' ) if exists_action : options . append ( ( '--exists-action=%s' % exists_action ) ) options = ' ' . join ( options ) command = ( '%(python_cmd)s -m %(pip_cmd)s install %(options)s -r %(filename)s' % locals ( ) ) if use_sudo : sudo ( command , user = user , pty = False ) else : run ( command , pty = False )
install requirements from a file .