def is_macports_env(): """ Check if Python interpreter was installed via Macports command 'port'. :return: True if Macports else otherwise. """ # Python path prefix should start with Macports prefix. env_prefix = get_macports_prefix() if env_prefix and base_prefix.startswith(env_prefix): return True return False
def is_homebrew_env(): """ Check if Python interpreter was installed via Homebrew command 'brew'. :return: True if Homebrew else otherwise. """ # Python path prefix should start with Homebrew prefix. env_prefix = get_homebrew_prefix() if env_prefix and base_prefix.startswith(env_prefix): return True return False