class_docstr: This class exists to allow virtual environment creation to be
  customized. The constructor parameters determine the builder's
  behaviour when called upon to create a virtual environment.
  
  By default, the builder makes the system (global) site-packages dir
  *un*available to the created environment.
  
  If invoked using the Python -m option, the default is to use copying
  on Windows platforms but symlinks elsewhere. If instantiated some
  other way, the default is to *not* use symlinks.
  
  :param system_site_packages: If True, the system (global) site-packages
                               dir is available to created environments.
  :param clear: If True, delete the contents of the environment directory if
                it already exists, before environment creation.
  :param symlinks: If True, attempt to symlink rather than copy files into
                   virtual environment.
  :param upgrade: If True, upgrade an existing virtual environment.
  :param with_pip: If True, ensure pip is installed in the virtual
                   environment
  :param prompt: Alternative terminal prefix for the environment.
  :param upgrade_deps: Update the base venv modules to the latest on PyPI
class_docstr_tok: ["This","class","exists","to","allow","virtual","environment","creation","to","be","customized",".","The","constructor","parameters","determine","the","builder's","behaviour","when","called","upon","to","create","a","virtual","environment",".","By","default",",","the","builder","makes","the","system","(","global",")","site-packages","dir","*","un","*","available","to","the","created","environment",".","If","invoked","using","the","Python","-m","option",",","the","default","is","to","use","copying","on","Windows","platforms","but","symlinks","elsewhere",".","If","instantiated","some","other","way",",","the","default","is","to","*","not","*","use","symlinks",".",":","param","system_site_packages",":","If","True",",","the","system","(","global",")","site-packages","dir","is","available","to","created","environments",".",":","param","clear",":","If","True",",","delete","the","contents","of","the","environment","directory","if","it","already","exists",",","before","environment","creation",".",":","param","symlinks",":","If","True",",","attempt","to","symlink","rather","than","copy","files","into","virtual","environment",".",":","param","upgrade",":","If","True",",","upgrade","an","existing","virtual","environment",".",":","param","with_pip",":","If","True",",","ensure","pip","is","installed","in","the","virtual","environment",":","param","prompt",":","Alternative","terminal","prefix","for","the","environment",".",":","param","upgrade_deps",":","Update","the","base","venv","modules","to","the","latest","on","PyPI"]
docstr: Create a virtual environment in a directory.
  
  :param env_dir: The target directory to create an environment in.
docstr_tok: ["Create","a","virtual","environment","in","a","directory",".",":","param","env_dir",":","The","target","directory","to","create","an","environment","in","."]
code: def create(self, env_dir):
      """
      Create a virtual environment in a directory.
  
      :param env_dir: The target directory to create an environment in.
  
      """
      env_dir = os.path.abspath(env_dir)
      context = self.ensure_directories(env_dir)
      # See issue 24875. We need system_site_packages to be False
      # until after pip is installed.
      true_system_site_packages = self.system_site_packages
      self.system_site_packages = False
      self.create_configuration(context)
      self.setup_python(context)
      if self.with_pip:
          self._setup_pip(context)
      if not self.upgrade:
          self.setup_scripts(context)
          self.post_setup(context)
      if true_system_site_packages:
          # We had set it to False before, now
          # restore it and rewrite the configuration
          self.system_site_packages = True
          self.create_configuration(context)
      if self.upgrade_deps:
          self.upgrade_dependencies(context)
  
imports: import logging
  import os
  import shutil
  import subprocess
  import sys
  import sysconfig
  import types
label_desc: Use image node_id 2 for calling the EnvBuilder obj's underlying member method code with example usage: obj.create(env_dir) without return types