def install_requirement(virtualenv_path, requirement):
 pip_path = os.path.join(virtualenv_path, 'bin/pip')
 cmd = [pip_path, 'install', requirement]
 env = get_env_for_subprocess_command()
 (exit_code, stdout, stderr) = run_command(cmd=cmd, env=env)
 if (exit_code != 0):
  raise Exception(('Failed to install requirement "%s": %s' % (requirement, stdout)))
 return True

def install_requirement ( virtualenv_path , requirement ) : pip_path = os . path . join ( virtualenv_path , 'bin/pip' ) cmd = [ pip_path , 'install' , requirement ] env = get_env_for_subprocess_command ( ) ( exit_code , stdout , stderr ) = run_command ( cmd = cmd , env = env ) if ( exit_code != 0 ) : raise Exception ( ( 'Failed to install requirement "%s": %s' % ( requirement , stdout ) ) ) return True
install a single requirement .