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

982
Vistas
FastAPI error: Cannot import name 'FastApi' from 'fastapi'

I want to use FastAPI. I installed it using pip, and when I am adding it to my project like that:

from fastapi import FastApi 

and running it, Iam getting the error:

cannot import name 'FastApi' from 'fastapi' (C:\Users\xxx\PycharmProjects\MyBank\venv\lib\site-packages\fastapi\__init__.py).

Can someone help me?

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

0

That should be as follows (with "API" being capitalised at the end):

from fastapi import FastAPI

Please have a look at the documentation.

over 4 years ago · Santiago Trujillo Denunciar

0

Might come from the fact that the name of your python file is actually fastapi and python is messed up by the fact that import is primarily looking at the current folder to import files then the libs.

meaning that if you have a file named : fastapi.py python will think that import fastapi means import the fastapi.py file from the current working dir and will fail.

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