1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Error loading ASGI app. Could not import module "src.main"

Discussão em 'Python' iniciado por Stack, Setembro 10, 2025.

  1. Stack

    Stack Membro Participativo

    I saw the solution is changing main -> src.main so I tried that, but the same problem is occuring even if I use cd src to move to src and run uvicorn main:app --reload, errors continue.

    What do I need?

    I am using a virtual environment but I tried running uvicorn without the vm and I get the same issue.

    code structure

    .
    |__ Alembic/
    |__ venv/
    |__ src/
    |__ main.py
    |__ services.py
    |__ database.py
    |__ models.py
    |__ __init__.py

    Continue reading...

Compartilhe esta Página