Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

857
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!