diff --git a/StreamingCommunity/Util/config_json.py b/StreamingCommunity/Util/config_json.py index 82dc1cd..14453dc 100644 --- a/StreamingCommunity/Util/config_json.py +++ b/StreamingCommunity/Util/config_json.py @@ -36,8 +36,13 @@ class ConfigManager: base_path = os.path.dirname(sys.executable) else: - # Use the current directory where the script is executed - base_path = os.getcwd() + + # Get the actual path of the module file + current_file_path = os.path.abspath(__file__) + # Navigate upwards to find the project root + # Assuming this file is in a package structure like StreamingCommunity/Util/config_json.py + # We need to go up 2 levels to reach the project root + base_path = os.path.dirname(os.path.dirname(os.path.dirname(current_file_path))) # Initialize file paths self.file_path = os.path.join(base_path, file_name)