def __init__(self, path=None, python=None, cache=None, readonly=False, system_site_packages=False): if path is None: path = get_env_path() if not path: raise VirtualenvPathNotFound('Path for virtualenv is not define or virtualenv is not activate') self.python = python self.system_site_packages = system_site_packages # remove trailing slash so os.path.split() behaves correctly if path[-1] == os.path.sep: path = path[:-1] # Expand path so shell shortcuts may be used such as ~ self.path = os.path.abspath(os.path.expanduser(path)) self.env = environ.copy() # Blacklist environment variables that will break pip in virtualenvs # See https://github.com/pypa/virtualenv/issues/845 self.env.pop('__PYVENV_LAUNCHER__', None) if cache is not None: self.env['PIP_DOWNLOAD_CACHE'] = os.path.expanduser(os.path.expandvars(cache)) self.readonly = readonly # True if the virtual environment has been set up through open_or_create() self._ready = False
def __init__(self, path=None, python=None, cache=None, readonly=False): if path is None: path = get_env_path() if not path: raise VirtualenvPathNotFound('Path for virtualenv is not define or virtualenv is not activate') self.python = python # remove trailing slash so os.path.split() behaves correctly if path[-1] == os.path.sep: path = path[:-1] # Expand path so shell shortcuts may be used such as ~ self.path = os.path.abspath(os.path.expanduser(path)) self.env = environ.copy() if cache is not None: self.env['PIP_DOWNLOAD_CACHE'] = os.path.expanduser(os.path.expandvars(cache)) self.readonly = readonly # True if the virtual environment has been set up through open_or_create() self._ready = False
def __init__(self, path=None, python=None, cache=None, readonly=False, system_site_packages=False): if path is None: path = get_env_path() if not path: raise VirtualenvPathNotFound( 'Path for virtualenv is not define or virtualenv is not activate' ) self.python = python self.system_site_packages = system_site_packages # remove trailing slash so os.path.split() behaves correctly if path[-1] == os.path.sep: path = path[:-1] # Expand path so shell shortcuts may be used such as ~ self.path = os.path.abspath(os.path.expanduser(path)) self.env = environ.copy() if cache is not None: self.env['PIP_DOWNLOAD_CACHE'] = os.path.expanduser( os.path.expandvars(cache)) self.readonly = readonly # True if the virtual environment has been set up through open_or_create() self._ready = False
def __init__(self, path=None, cache=None): if path is None: path = get_env_path() if not path: raise VirtualenvPathNotFound('Path for virtualenv is not define or virtualenv is not activate') # remove trailing slash so os.path.split() behaves correctly if path[-1] == os.path.sep: path = path[:-1] self.path = path self.env = environ.copy() if cache is not None: self.env['PIP_DOWNLOAD_CACHE'] = os.path.expanduser(os.path.expandvars(cache)) # True if the virtual environment has been set up through open_or_create() self._ready = False