def in_virtual_env():
    print(('sys.real_prefix=%r' % (getattr(sys, 'real_prefix', None),)))
    print(('sys.base_prefix=%r' % (getattr(sys, 'base_prefix', None),)))
    print(('sys.prefix=%r' % (getattr(sys, 'prefix', None),)))
    in_venv = False
    if hasattr(sys, 'real_prefix'):
        in_venv = True
    elif hasattr(sys, 'base_prefix'):
        in_venv = (sys.base_prefix != sys.prefix)
    return in_venv
def in_virtual_env():
    print(('sys.real_prefix=%r' % (getattr(sys, 'real_prefix', None),)))
    print(('sys.base_prefix=%r' % (getattr(sys, 'base_prefix', None),)))
    print(('sys.prefix=%r' % (getattr(sys, 'prefix', None),)))
    in_venv = False
    if hasattr(sys, 'real_prefix'):
        in_venv = True
    elif hasattr(sys, 'base_prefix'):
        in_venv = (sys.base_prefix != sys.prefix)
    return in_venv