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

301
Views
ModuleNotFoundError: ningún módulo llamado 'fastapi.responses'

Estoy tratando de usar HTMLResponse de FastAPI, como se describe en la documentación . Estoy en la versión 0.70. Sigo recibiendo el siguiente error:

 ModuleNotFoundError: No module named 'fastapi.responses'

Mi código se muestra a continuación:

 from fastapi import FastAPI from fastapi.responses import HTMLResponse import os from os import curdir, environ as env app = FastAPI() name='fred' @app.get("/getName") def returnName(): html_content = """ <html> <head> <title>Some HTML in here</title> </head> <body> <h1>Name is {{name}}</h1> </body> </html> """ return HTMLResponse(content=html_content, status_code=200)

¿Algunas ideas?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Dado que FastAPI se basa en Starlette, intente esto:

 from starlette.responses import HTMLResponse
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!