Skip to content

Import Error in Main.py #4281

@tonyhart7

Description

@tonyhart7

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google "How to X in FastAPI" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to FastAPI but to Pydantic.
  • I already checked if it is not related to FastAPI but to Swagger UI.
  • I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

from sqlalchemy.orm import Session

from . import crud, models, schemas
from .database import SessionLocal, engine

Description

this is my main.py file

and as you can see I want to import crud,model and schemas by following official doc at https://fastapi.tiangolo.com/tutorial/sql-databases/

but I cant import all that why that happen ??

Operating System

Windows

Operating System Details

Windows 11

FastAPI Version

0.70.1

Python Version

Python 3.10.0

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions