Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

864
Vistas
ERROR: Error loading ASGI app. Import string "main" must be in format "<module>:<attribute>"

Trying to test my first FastApi code using uvicorn.

Following code written on Jupyter Notebook and saved as 'main.py' in the directory: /home/user

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}

From the same directory I am running:

$uvicorn main --reload

It is throwing the following error:

ERROR: Error loading ASGI app. Import string "main" must be in format ":".

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Use:

uvicorn main:app --reload

P.S. I would highly suggest to take the FastAPI tutorial, before posting further questions here.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda