From 35d23b2ef90ed5fee792a4c1d6f418abb34d74c7 Mon Sep 17 00:00:00 2001 From: aitbc Date: Sat, 25 Apr 2026 08:08:23 +0200 Subject: [PATCH] fix: add REPO_DIR to PYTHONPATH in service wrappers The wrapper scripts were setting PYTHONPATH to only the app's src directory, causing 'ModuleNotFoundError: No module named aitbc' when services tried to import from the aitbc package. Added REPO_DIR to PYTHONPATH in coordinator-api, agent-coordinator, and explorer wrappers to allow aitbc imports. --- scripts/wrappers/aitbc-agent-coordinator-wrapper.py | 2 +- scripts/wrappers/aitbc-coordinator-api-wrapper.py | 2 +- scripts/wrappers/aitbc-explorer-wrapper.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/wrappers/aitbc-agent-coordinator-wrapper.py b/scripts/wrappers/aitbc-agent-coordinator-wrapper.py index 83ef3d11..e5dd14de 100755 --- a/scripts/wrappers/aitbc-agent-coordinator-wrapper.py +++ b/scripts/wrappers/aitbc-agent-coordinator-wrapper.py @@ -16,7 +16,7 @@ from aitbc import ENV_FILE, NODE_ENV_FILE, REPO_DIR, DATA_DIR, LOG_DIR # Set up environment using aitbc constants os.environ["AITBC_ENV_FILE"] = str(ENV_FILE) os.environ["AITBC_NODE_ENV_FILE"] = str(NODE_ENV_FILE) -os.environ["PYTHONPATH"] = f"{REPO_DIR}/apps/agent-coordinator/src" +os.environ["PYTHONPATH"] = f"{REPO_DIR}:{REPO_DIR}/apps/agent-coordinator/src" os.environ["DATA_DIR"] = str(DATA_DIR) os.environ["LOG_DIR"] = str(LOG_DIR) diff --git a/scripts/wrappers/aitbc-coordinator-api-wrapper.py b/scripts/wrappers/aitbc-coordinator-api-wrapper.py index 82a6b898..002634e5 100755 --- a/scripts/wrappers/aitbc-coordinator-api-wrapper.py +++ b/scripts/wrappers/aitbc-coordinator-api-wrapper.py @@ -17,7 +17,7 @@ from aitbc import ENV_FILE, NODE_ENV_FILE, REPO_DIR, DATA_DIR, LOG_DIR # Set up environment using aitbc constants os.environ["AITBC_ENV_FILE"] = str(ENV_FILE) os.environ["AITBC_NODE_ENV_FILE"] = str(NODE_ENV_FILE) -os.environ["PYTHONPATH"] = f"{REPO_DIR}/apps/coordinator-api/src" +os.environ["PYTHONPATH"] = f"{REPO_DIR}:{REPO_DIR}/apps/coordinator-api/src" os.environ["DATA_DIR"] = str(DATA_DIR) os.environ["LOG_DIR"] = str(LOG_DIR) diff --git a/scripts/wrappers/aitbc-explorer-wrapper.py b/scripts/wrappers/aitbc-explorer-wrapper.py index 815133c5..a05f2ccb 100755 --- a/scripts/wrappers/aitbc-explorer-wrapper.py +++ b/scripts/wrappers/aitbc-explorer-wrapper.py @@ -17,7 +17,7 @@ from aitbc import ENV_FILE, NODE_ENV_FILE, REPO_DIR, DATA_DIR, LOG_DIR # Set up environment using aitbc constants os.environ["AITBC_ENV_FILE"] = str(ENV_FILE) os.environ["AITBC_NODE_ENV_FILE"] = str(NODE_ENV_FILE) -os.environ["PYTHONPATH"] = f"{REPO_DIR}/apps/blockchain-explorer" +os.environ["PYTHONPATH"] = f"{REPO_DIR}:{REPO_DIR}/apps/blockchain-explorer" os.environ["DATA_DIR"] = str(DATA_DIR) os.environ["LOG_DIR"] = str(LOG_DIR)