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

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

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 Report

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 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!