Deployment Issue: ModuleNotFoundError for Flask with Poetry-based Project
Hello, I'm having trouble deploying a Flask app on Railway using Poetry for dependency management. Despite having Flask listed in my pyproject.toml file, the deployment logs keep showing a ModuleNotFoundError for Flask. I've verified that Flask is correctly specified in my pyproject.toml. Has anyone encountered this issue when deploying with Poetry on Railway? Any guidance would be much appreciated. Thank you!
10 Replies
Project ID:
1fdaefcc-07e9-4a72-870a-ccc581cf5b25
1fdaefcc-07e9-4a72-870a-ccc581cf5b25
do you happen to also have a requirements.txt file?
Please share what you're filling out in pyproject.toml.
Hey Brody and Furimu,
Thanks for getting back so quick!
@Brody : Yep, was using poetry with a pyproject.toml before. Switched over to a requirements.txt now for the Railway deploy.
@furimu : About the pyproject.toml - it had the usual stuff, dependencies and all. But since I'm on requirements.txt now, not sure if that matters anymore. Still, if you wanna see it, just let me know.
Got the app up on Railway, but hitting an endpoint doesn’t give any response. Kinda stumped here.
Here is my procfile:
and my app.py
and the command I'm using to call the server
curl -X GET <url>/test
Thanks a ton for the help!what is the url?
btw, what i was getting at was that railway checks for a requirements.txt before it checks for a pyproject.toml, and will use whatever it finds first so im gussing it found the requirements.txt file and it didnt have flask in it
it may be a typo, but just thought id mentioned it, you said
procfile
but that file requires a capital P
If it's a Module not found error, it's not Procfile's fault.
@CalebPlease share what you're filling out in requirements.txt
would you happen to be using ai to answer these questions?
okay then please translate and read the persons message you are replying to