python: command not found

lehyanis
HOBBYOP

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
HOBBYOP

2 years ago

Yes, I have


2 years ago

Do you need it for anything?


lehyanis
HOBBYOP

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
HOBBYOP

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
HOBBYOP

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('MYSQLDATABASE'), 'USER': env('MYSQLUSER'),
'PASSWORD': env('MYSQLPASSWORD'), 'HOST': env('MYSQLHOST'),
'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
HOBBYOP

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.readenv() DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': env('MYSQLDATABASE'),
'USER': env('MYSQLUSER'), 'PASSWORD': env('MYSQLPASSWORD'),
'HOST': env('MYSQLHOST'), 'PORT': env('MYSQLPORT'),
}
}

in railway the variables :
MYSQLUSER MYSQLPASSWORD
MYSQLHOST MYSQLPORT
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
HOBBYOP

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

10 months 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

10 months ago

Please open your own thread.


Loading...