A boolean representing whether the running interpreter is from a virtual environment.
The default name of the virtual envirnoment directory created by
create(). The value is
- exception microvenv.ActivationError
An error trying to calculate environment activation via
pyvenv.cfgfile in the specified virtual environment.
A dict is returned with strings for keys and values. All keys are lowercased, but otherwise no validation is performed. No changes are made to the values (e.g.,
include-system-site-packagesis not converted to a boolean, nor lowercased).
Parsing is done in a way identical to how the
sitemodule does it. This means that ANY line with an
=sign is considered a line with a key/value pair on it. As such, all other lines are treated as if they are comments. But this also means that having a line start with e.g.,
#does not signify a comment either if there is a
=in the line.
Returns a dict with env vars to activate the current virtual environment.
If the current interpreter is not from a virtual environment,
Since this API is designed to be additive to a environment variables dict (i.e.,
os.environ | activation()), key deletions are not supported. As such,
ActivationErroris raised if
PYTHONHOMEis found to be set.
No environment variables are provided in the returned dict in relation to shell prompts.