shaare.it

ModuleNotFoundError: No module named 'app'

7 Dec 2025

1 min read

ModuleNotFoundError: No module named ‘app’

$ python manage.py runserver
Traceback (most recent call last):
  ...
ModuleNotFoundError: No module named 'app'

Why this happens

Package path wrong, missing __init__.py, or virtualenv not active.

Fix

Activate env, ensure app is inside project and has __init__.py, and adjust PYTHONPATH if needed.

Wrong code

from app import views

Fixed code

from myproject.app import views  # correct dotted path