Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

984
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda