ImportError on python app deployment
Hello
i'm totally new to app deployment via GH. My app keep crashing due to err: "cannot import name 'Annotated' from 'typing' ".
By this error i suppose i have to downgrade some python package.
I've linked project via cli (python).
Could you help solving this error? Thanks
18 Replies
Project ID:
c7394ece-6242-4b88-97ef-f504211fcbd5
c7394ece-6242-4b88-97ef-f504211fcbd5
do you have all your packages in your requirements.txt file?
yes
alembic==1.12.1
annotated-types==0.6.0
anyio==3.7.1
click==8.1.7
fastapi==0.104.1
greenlet==3.0.1
h11==0.14.0
idna==3.6
Mako==1.3.0
MarkupSafe==2.1.3
psycopg2==2.9.9
pydantic==2.5.2
pydantic_core==2.14.5
sniffio==1.3.0
SQLAlchemy==2.0.23
starlette==0.27.0
typing_extensions==4.8.0
uvicorn==0.24.0.post1
can you confirm that your code works locally with those specific packages installed?
i confirm (python version is 3.11.6)
mind sharing your repo? I’ll play around with it
sorry for bother but actually i changed 1 import and the error is changed in : Is the server running on that host and accepting TCP/IP connections?
Please send the full logs https://bookmarklets.up.railway.app/log-downloader/
sharing repo would be ok..
tell me how to do
You're attempting to connect to something through localhost, that's why it's failing
On Railway, whatever that is should be hosted as a second service and connected through private networking
Looks like it's your db that is failing to connect
what sort of db is it?
postgresql
wrong DB url, thanks for pointing that out
By that error it seems i can't deal with Db Url . Can you show me how to set a variable? Do i need a .env file? Thanks
Here are the docs for environment variables https://docs.railway.app/develop/variables
do you want repo's url?
no thank you
it seems be working now!
thanks!!
you guys are amazing! (but stay tuned, i have tons of questions😉 )
happy to help