Not able to install FAST API on Macbook M1

In the line


from fastapi import FastAPI, UploadFile, File, HTTPException

I am getting the error, ImportError: cannot import name dataclass_transform


I tried to install dataclass_transform seperately but no such package was found, can somebody help

It’d be better to post this query on fastapi github discussions and provide a link on this thread since M1 specific aspects are likely to find a proper fix there.

I wasn’t sure however, that this is a M1 related problem

I posted this query there too

I’m able to install on linux:

$ pip install fastapi==0.63.0
>>> import fastapi
>>> fastapi.__version__
'0.63.0'
>>> from fastapi import FastAPI, UploadFile, File, HTTPException
>>> 

Try using the docker approach. If that doesn’t work, head to fastapi issues page. Don’t forget to mention the github issue link on this thread.