(self, env_dir)
Create a virtual environment in a directory.

        :param env_dir: The target directory to create an environment in.
Create a virtual environment in a directory.
Create a virtual environment in a directory .
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)
def create ( self , env_dir ) : 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 )