def _install_requirements(self):
if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>err = '<STR_LIT>'<EOL>raise Exception(err)<EOL><DEDENT>cmd = None<EOL>if self._requirements:<EOL><INDENT>LOG.debug("<STR_LIT>"<EOL>% self._requirements)<EOL>cmd = [os.path.join(self._pkg_venv, self._venv_pip),<EOL>'<STR_LIT>'] + self._requirements<EOL><DEDENT>elif _isfile(self._requirements_file):<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL>cmd = [os.path.join(self._pkg_venv, self._venv_pip),<EOL>"<STR_LIT>", "<STR_LIT>",<EOL>self._requirements_file]<EOL><DEDENT>if cmd is not None:<EOL><INDENT>prc = Popen(cmd, stdout=PIPE, stderr=PIPE)<EOL>stdout, stderr = prc.communicate()<EOL>LOG.debug("<STR_LIT>" % stdout)<EOL>LOG.debug("<STR_LIT>" % stderr)<EOL>if prc.returncode is not <NUM_LIT:0>:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT><DEDENT>
Create a new virtualenvironment and install requirements
if there are any.