Skip to content

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

@lokesh12344

Description

@lokesh12344

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions