10 months ago
Hi Railway Team,
I've been trying to deploy a simple Flask app on Railway using Nixpacks, and I’ve hit a frustrating wall. My app keeps crashing on startup with the following error:
vbnetCopyEdit
ModuleNotFoundError: No module named 'requests'
Here’s what I’ve set up:
Project Structure
requirements.txtincludes:nginxCopyEdit
flask requests stripe python-dotenv coloramastart.sh:bashCopyEdit
#!/bin/bash pip install -r requirements.txt python app.py.nixpacks.toml:tomlCopyEdit
[phases.setup] nixPkgs = ["python311", "gcc"] [phases.install] cmds = [ "python3.11 -m venv venv", ". venv/bin/activate", "pip install -r requirements.txt" ] [phases.start] cmd = ". venv/bin/activate && python app.py"Procfile:makefileCopyEdit
web: python app.pyThe Railway service is set to use the Nixpacks builder and Python is selected in the Providers.
The Problem
Despite everything being correctly defined, Railway crashes on every deploy with the same error:ModuleNotFoundError: No module named 'requests'
This suggests the pip install -r requirements.txt step is being skipped or not properly executed, even though it’s in both start.sh and .nixpacks.toml.
What I’ve Tried
Setting a custom start command in Railway to run
bash start.shMaking
start.shexecutable withgit update-index --chmod=+x start.shAdding
.nixpacks.tomlto explicitly define build phasesSwitching between
Procfileand.nixpacks.tomlConfirmed
requestsis definitely listed inrequirements.txt
Nothing seems to be triggering the install properly.
Any ideas why Railway isn't installing the requests package on build?
Would greatly appreciate help getting this resolved!
Thanks so much,
Alan (aka chidopro)
2 Replies
10 months ago
Just checking in to see if anyone has thoughts on this. Still having the same issue where requests isn't being installed during deployment, even with a proper requirements.txt and start.sh. Any guidance would be amazing — thanks!
Status changed to Awaiting User Response Railway • 10 months ago
6 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 6 months ago