()
return False
Return True if we're running inside a virtualenv, False otherwise.
Return True if we're running inside a virtualenv, False otherwise.
Return True if we re running inside a virtualenv False otherwise .
def running_under_virtualenv():
    # type: () -> bool
    """
    Return True if we're running inside a virtualenv, False otherwise.

    """
    if hasattr(sys, 'real_prefix'):
        # pypa/virtualenv case
        return True
    elif sys.prefix != getattr(sys, "base_prefix", sys.prefix):
        # PEP 405 venv
        return True

    return False
def running_under_virtualenv ( ) : # type: () -> bool if hasattr ( sys , 'real_prefix' ) : # pypa/virtualenv case return True elif sys . prefix != getattr ( sys , "base_prefix" , sys . prefix ) : # PEP 405 venv return True return False