Skip to content

Missing __init__.py in Python template subpackages breaks imports #335

@notgitika

Description

@notgitika

Description

model/ and mcp_client/ directories in all 6 Python framework templates have no __init__.py. Imports in main.py rely on implicit namespace packages, which break depending on working directory, packaging tool (e.g., hatch build), or deployment method.

Steps to Reproduce

  1. agentcore create with any Python framework
  2. cd into the agent directory
  3. hatch build or run from a different working directory
  4. Observe ModuleNotFoundError for model or mcp_client imports

Expected Behavior

model/ and mcp_client/ should be proper Python packages with __init__.py, so imports work regardless of working directory or packaging method.

Actual Behavior

Imports fail when the working directory differs or when using packaging tools that require explicit packages.

Operating System

macOS

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions