/bin/bash: line 1: python: command not found
I'm facing an issue while deploying my Django project on Railway. The deployment logs show the error message "/bin/bash: line 1: python: command not found," even though I have both a requirement.txt file and a runtime.txt file in my project. I'm unsure about the cause of this problem and would appreciate some guidance from a professional developer.
Project id: 50a5c2a5-ff5d-45f0-b4e1-b8e9b312ab96
Solution:Jump to solution
i dont have your code to test with, so this is untested, but let me know how it goes
```json
{
"$schema": "https://railway.app/railway.schema.json",
"build": {...
35 Replies
Project ID:
50a5c2a5-ff5d-45f0-b4e1-b8e9b312ab96
do you happen to have a package.json in your project too?
Yes I do
then railway is detecting your project as a node js project and installing node instead of python.
why do you have a package.json?
I am using flowbite and tailwind
Whats the work around
a modifyed railway.json file
Thanks for your quick replies. Much appreciated
I can do this for you, but I'm about to eat dinner, so I'll get back to you later
oh great.
Enjoy your dinner. Its morning time here in Australia.
am back, please send me your current railway.json file, every deployment has one, even failed deployments, it is located in the details tab of a deployment
ok
I do have railway.json file in my repo
oh perfect, send that then
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn webapp.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
fwiw you can enclose multi-line code in triple backticks
Solution
i dont have your code to test with, so this is untested, but let me know how it goes
you are a legend. thank you heaps . let me test this. Update you soon.
It worked
thank you so much .
very helpful.
awsome, glad i could help!
I owe you a coffee
haha thanks
so what did you do in the railway.txt
overrode the provider back to only python since your main app is python, then added node js as a package, installed the node dependencies with the
npm ci
build command, and left the start command in tact
theres no documentation for this exact use case, ive just used vscode with the schema auto completelol
thats amazing
whats your background? are you a developer?
not professionally, just for fun
as odd as it may sound, i dont really have a background
oh ok
have you worked with django?
zero django experience
lol ok
whats your strength?
helping people with their railway issues
ok cool
Thats very kind of you
well I know where to come when I need help with railway
you sure do!
I'm having this exact same issue for my Django app for which I'm using React as the frontend (so have a package.json). @Brody , you mentioned
please send me your current railway.json file, every deployment has one, even failed deployments, it is located in the details tab of a deployment
I can't seem to find the details tab or the railway.json file. Has it moved by chance?it hasn't moved, but you may be able to use the railway.json file I sent above, just with a slight modification to the start command
Ah thanks! I see, I just add it to my repo. Will try that when I get home later!
And will modify the start command accordingly
perfect, but if you are still facing issues in the future I ask that you open a new thread as to avoid spamming the OP with notifications
Thanks Brody Very much this helped me now. I was also facing the same issue. i just copy pasted your railway.json and it started working for me <:meow_wine:802401834643882034>
Awesomeness