python: command not found
lehyanis
PROOP

2 years ago

when I try to deploy Django I got this error :

/bin/bash: line 1: python: command not found

Solved

15 Replies

2 years ago

Does your project have an npm lock file in it?


lehyanis
PROOP

2 years ago

Yes, I have


2 years ago

Do you need it for anything?


lehyanis
PROOP

2 years ago

I got this file from template that i buy, It is included by default, I think it include everything


2 years ago

I'd need to see the code to be able to advise on a path forward here, otherwise I'm just left guessing.


lehyanis
PROOP

2 years ago

which file you need to see? package-lock.json ? or additional files?


2 years ago

I would like to see the entire repo to get a good understanding of what is going on.


lehyanis
PROOP

2 years ago

now the error :

/usr/local/lib/python3.11/site-packages/environ/environ.py:628: UserWarning: /app/velzon/.env doesn't exist - if you're not configuring your environment separately, create one.

i have .env under my site folder and in setting.py:

DATABASES = {

'default': {

'ENGINE': 'django.db.backends.mysql',

'NAME': env('MYSQL_DATABASE'),

'USER': env('MYSQL_USER'),

'PASSWORD': env('MYSQL_PASSWORD'),

'HOST': env('MYSQL_HOST'),

'PORT': env('MYSQL_PORT'),

}

}

and i copy content of .env and pasted on railway Variables

but still the site : Application failed to respond

my repo : https://github.com/lehyanis/django


2 years ago

You wouldn't want to be using an .env file when deploying to Railway as all environment variables should be set via the service variables.


lehyanis
PROOP

2 years ago

I delete this repo and create other one with gitignore and shared MySQL variables to django but still i have same error:

/usr/local/lib/python3.11/site-packages/environ/environ.py:628: UserWarning: /app/velzon/.env doesn't exist - if you're not configuring your environment separately, create one.

in setting i use :

import environ

env = environ.Env()

environ.Env.read_env()

DATABASES = {

'default': {

'ENGINE': 'django.db.backends.mysql',

'NAME': env('MYSQL_DATABASE'),

'USER': env('MYSQL_USER'),

'PASSWORD': env('MYSQL_PASSWORD'),

'HOST': env('MYSQL_HOST'),

'PORT': env('MYSQL_PORT'),

}

}

in railway the variables :

MYSQL_USER

MYSQL_PASSWORD

MYSQL_HOST

MYSQL_PORT

MYSQL_DATABASE


2 years ago

You wouldn't want to be using an .env file when deploying to Railway as all environment variables should be set via the service variables.


lehyanis
PROOP

2 years ago

in the repo there is no .env file and the deploying was done without it also I update the Railway environment with MySQL variables, so where the is the issues ?


2 years ago

Your code is looking for an .env file.


brody

Your code is looking for an .env file.

ielo1
TRIAL

a year ago

hello, i'm experiencing this same issue "command not found". i tried all configurations, no luck. hope you can help me. thanks


ielo1

hello, i'm experiencing this same issue "command not found". i tried all configurations, no luck. hope you can help me. thanks

a year ago

Please open your own thread.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...