@staticmethod<EOL><INDENT>def create_virtualenv(venv_dir, use_venv_module=True):<DEDENT>
if not use_venv_module:<EOL><INDENT>try:<EOL><INDENT>check_call(['<STR_LIT>', venv_dir, '<STR_LIT>'])<EOL><DEDENT>except OSError:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>check_call([sys.executable or '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', venv_dir])<EOL><DEDENT>
creates a new virtualenv in venv_dir

By default, the built-in venv module is used.
On older versions of python, you may set use_venv_module to False to use virtualenv