Do I need do install pip

I'm installing a custom package in railway.yaml but getting pip error - how can I fix it? railway.toml:
[build]
builder = "nixpacks"
buildCommand = "git clone https://username:[email protected]/org/my-module.git && cd my-module && pip install -e ."
[build]
builder = "nixpacks"
buildCommand = "git clone https://username:[email protected]/org/my-module.git && cd my-module && pip install -e ."
logs:
0.278 Cloning into 'my-module'...
4.171 /bin/bash: line 1: pip: command not found
0.278 Cloning into 'my-module'...
4.171 /bin/bash: line 1: pip: command not found
Why is this not working?
19 Replies
Percy
Percy7mo ago
Project ID: c5ad221b-8b00-4b24-b8c9-eac5b00a9054
Charles_
Charles_7mo ago
c5ad221b-8b00-4b24-b8c9-eac5b00a9054
Adam
Adam7mo ago
If your project isn’t detected as a python project (doesn’t have a main.py or isn’t the primary language) then you’ll have to tell nixpacks to install python. Create a nixpacks.toml file and add “python3” to the providers section
Adam
Adam7mo ago
make sure to include the “…” as well as that tells nixpacks to install the detected packages as well @Charles_ for visibility ^
Brody
Brody7mo ago
the real question is, why are you having your build clone a repo instead of letting railway's infra do that for you?
Charles_
Charles_7mo ago
it seems that adding requirements.txt at project root fixed it - but I only need setup.py. Would that also work with nixpacks.toml if I remove requirements.txt? @Brody would love to hear the better alternative - this does feel clunky I'm actually installing 6 different private module which makes for a very long and awkward buildCommand
Brody
Brody7mo ago
attach your repo to the service
Charles_
Charles_7mo ago
That's what I've done for the main app, but it has deps on 6 private modules
Brody
Brody7mo ago
Fair, this sounds like an absolute pain to do with nixpacks, i would highly recommend this be done with a Dockerfile
Charles_
Charles_7mo ago
Thanks I will give it a go @Brody just checking; are you aware of any issues/downsides from using supervisord inside Dockerfile for managing long-running processes? I would have them split as two railway services but both processes need access to a shared volume which AFAIK isn't possible.
Medim
Medim7mo ago
I use supervisor on a demanding php-fpm service on Railway and never had any issues with it.
Charles_
Charles_7mo ago
nice, good to hear!
Brody
Brody7mo ago
yeah it's totally fine, but personally, I much prefer parallel far far simpler https://github.com/railwayapp-templates/browserless/blob/main/scripts/start.sh
Charles_
Charles_7mo ago
Thanks, how can I avoid this Dockerfile caching? This layers runs git clone & pip install on repo's I've made commits to
Charles_
Charles_7mo ago
No description
Brody
Brody7mo ago
set a service variable NO_CACHE to 1
Charles_
Charles_7mo ago
@Brody please send me friend request if you're interested in paid work (deploying docker-compose to Railway)
Brody
Brody7mo ago
well I'm honestly just more curious as to what you want to deploy more than anything
Want results from more Discord servers?
Add your server