def is_macports_env():
 env_prefix = get_macports_prefix()
 if (env_prefix and base_prefix.startswith(env_prefix)):
  return True
 return False

def is_macports_env ( ) : env_prefix = get_macports_prefix ( ) if ( env_prefix and base_prefix . startswith ( env_prefix ) ) : return True return False
check if python interpreter was installed via macports command port .