diff --git a/skills/productivity/google-workspace/scripts/google_api.py b/skills/productivity/google-workspace/scripts/google_api.py index 2a5c662a65..ece0c3ea03 100644 --- a/skills/productivity/google-workspace/scripts/google_api.py +++ b/skills/productivity/google-workspace/scripts/google_api.py @@ -27,7 +27,13 @@ from datetime import datetime, timedelta, timezone from email.mime.text import MIMEText from pathlib import Path -from hermes_constants import display_hermes_home, get_hermes_home +try: + from hermes_constants import display_hermes_home, get_hermes_home +except ModuleNotFoundError: + HERMES_AGENT_ROOT = Path(__file__).resolve().parents[4] + if HERMES_AGENT_ROOT.exists(): + sys.path.insert(0, str(HERMES_AGENT_ROOT)) + from hermes_constants import display_hermes_home, get_hermes_home HERMES_HOME = get_hermes_home() TOKEN_PATH = HERMES_HOME / "google_token.json" diff --git a/skills/productivity/google-workspace/scripts/setup.py b/skills/productivity/google-workspace/scripts/setup.py index 52a07427df..5e4924f9d2 100644 --- a/skills/productivity/google-workspace/scripts/setup.py +++ b/skills/productivity/google-workspace/scripts/setup.py @@ -27,7 +27,13 @@ import subprocess import sys from pathlib import Path -from hermes_constants import display_hermes_home, get_hermes_home +try: + from hermes_constants import display_hermes_home, get_hermes_home +except ModuleNotFoundError: + HERMES_AGENT_ROOT = Path(__file__).resolve().parents[4] + if HERMES_AGENT_ROOT.exists(): + sys.path.insert(0, str(HERMES_AGENT_ROOT)) + from hermes_constants import display_hermes_home, get_hermes_home HERMES_HOME = get_hermes_home() TOKEN_PATH = HERMES_HOME / "google_token.json"