I have simple fastapi project. I have 3 directory and i am calling my model from other directory its showing that
from shakeitupapp.models.category import CategoryModel
ModuleNotFoundError: No module named 'shakeitupapp'
You can see my file structure i have added init in each directory
And the file i am calling is simply this
from pydantic import BaseModel, Field
from typing import Optional
from fastapi.encoders import jsonable_encoder
class CategoryModel(BaseModel):
categoryName: str = Field(...)
categoryType: Optional[str] = None
I tru to import like these 2 but nothing works
from shakeitupapp.models.category import CategoryModel
from ..models.category import CategoryModel