R
Railway

✋|help

Deployment Issue: ModuleNotFoundError for Flask with Poetry-based Project

Ccaleb45368/23/2023
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!
Ccaleb45368/23/2023
1fdaefcc-07e9-4a72-870a-ccc581cf5b25
Bbrody1928/23/2023
do you happen to also have a requirements.txt file?
Ffuri.mu8/23/2023
Please share what you're filling out in pyproject.toml.
Ccaleb45368/23/2023
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:

web: gunicorn app:app


and my app.py

from flask import Flask, jsonify
# import oss

app = Flask(__name__)

@app.route('/test', methods=['GET'])
def test():
    return "Hello, World!"

if __name__ == "__main__":
    app.run()


and the command I'm using to call the server

curl -X GET <url>/test

Thanks a ton for the help!
Bbrody1928/23/2023
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
Ffuri.mu8/24/2023
If it's a Module not found error, it's not Procfile's fault.

@CalebPlease share what you're filling out in requirements.txt
Bbrody1928/24/2023
would you happen to be using ai to answer these questions?
Ffuri.mu8/24/2023
no, sorry i use [deepl](https://www.deepl.com/translator)
Bbrody1928/24/2023
okay then please translate and read the persons message you are replying to

Looking for more? Join the community!

Recommended Posts
Does HTTP response count towards egress quota?I just want to check an external endpoint a few times a day but the response is quite big.Hosting a Directus + NuxtJs project service availableI'm trying to host a Directus service and NuxtJs service but I'm having some trouble getting the froDB StorageHello all, I have a question. How much storage does Railway have when building a server or databaseLogs broken?Hello is there a problem with logs? I am not seeing any build or deploy logs at all, I just see the Minecraft Server isn't working?When I use the minecraft server template and leave everything it will give this error in the logs anFormbricks Template error (upon redeployment w/ SMTP setup)``` error getting environment TypeError: fetch failed at Object.fetch (node:internal/deps/undicPayload CMS + Nextjs Deployment Failed during build processUsing the template courtesy of @Brody with Next.js added [as seen here](https://github.com/payloadcmHosting a modded Minecraft serverHi guys! I'm trying to host a modded minecraft server through Railway using the `Minecraft Server` tCan't connect to RedisThis is the error I am getting. What I have checked so far * Made sure I used the env variables provHello everyone, i'm trying to make a python websocket using websockets library also flaskso basically i have this -> ```py async def main(): url = os.environ.get('RAILWAY_URL', 'localExtension of Payment Due Date for SubscriptionIs there a way I can request for a brief extension of a few days for my upcoming payment?Hello Everyone! I am facing some problem related to deploying my nodejs application.I have deployed my nodejs application using github, but do not know how can I connect phpmyadmin so RedeployHey there, is there away to start a redploy using the Railway APIKafka Connectioncould anyone help me setup kafka cluster? I've went through the deployment process but getting a conHosting a monorepo with a Vite/Svelte Front and and a Fiber BackendI am trying to host my monorepo application within railway however I am facing some issues when tryiUnexpected timeouts and slow downsHey guys! I'm writing this post since we've been experimenting some slow downs and timeouts during tconfigure variable in VM ARGUMENTSI would like to know how do I create a variable "VM Arguments" in the railway environment? currentluhmm i think i filled the entire disk somehowservice id: 66b587c8-3c50-4dd0-8dfa-394ade04a0eci want to deploy a wordpres, is it possible?project id fb928ae2-62f0-4f8f-be68-9f7902efbebdBilled per usage plan with carryoverHey guys, I'm currently on a usage based plan but my app is only projected to use $1.70/month. Will