Skip to content

fix: resolve NameError and import pathing in main.py#389

Open
lokesh12344 wants to merge 1 commit intofireform-core:mainfrom
lokesh12344:fix/main-py-imports
Open

fix: resolve NameError and import pathing in main.py#389
lokesh12344 wants to merge 1 commit intofireform-core:mainfrom
lokesh12344:fix/main-py-imports

Conversation

@lokesh12344
Copy link
Copy Markdown

@lokesh12344 lokesh12344 commented Mar 30, 2026

Description

This PR fixes two critical bugs in src/main.py that prevented the script from running successfully in a standard environment.

Changes

  1. Fixed NameError: Added from typing import Union. The Union type hint was used on line 14 but was never imported, causing the script to crash immediately upon execution.
  2. Fixed Import Pathing: Changed from controller import Controller to from src.controller import Controller. This ensures the script can be run from the project root directory (standard practice) without triggering a ModuleNotFoundError.

How to Verify

Before this fix, running python3 src/main.py from the root would result in:

  • NameError: name 'Union' is not defined
  • ModuleNotFoundError: No module named 'controller'

After this fix, the script successfully imports all dependencies and initializes the Controller.
Fixes #388

@lokesh12344
Copy link
Copy Markdown
Author

Issue #388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] main.py fails to run due to missing Union import and pathing issues

1 participant