#FastAPI Module Not Found while deployment

16 messages · Page 1 of 1 (latest)

brave schooner
#

Hi, my build was successful, however in deployment log I'm getting below error:

File "main.py", line 5, in <module>
from fastapi import FastAPI
ModuleNotFoundError: No module named 'fastapi'

Is there something I'm missing? (I have tested my app on local and it works)

Thanks.

granite rainBOT
#

Project ID: 46d910cb-3407-4040-a999-08e380fe1a5f

brave schooner
#

Project ID: 46d910cb-3407-4040-a999-08e380fe1a5f

nova slate
#

Do you have fastapi in your requirements.txt file?

brave schooner
#

no I didn't upload requiremnts.txt

#

with my repo

#

If that's the case, will do it right away.

#

this was left out due to gitignore

nova slate
#

Do you have .gitnore set up properly?

brave schooner
#

I was able to deploy successfully, but few later it shows deployment removed

#

with same error

#

This the current error:
Application Error
Is your app correctly listening on $PORT?

#

It's because I'm getting a 503 error, even if I hit my hosted endpoints. Do you have any lead?

#

I remember setting my env variables.

kind wedge
#

Hi, I’m new to Railway. I’m experiencing the same issue with my FastAPI project, where I deploy with a PORT env variables but I still get an Application Error with that message.