#Do I need do install pip

25 messages · Page 1 of 1 (latest)

analog vapor
#

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 ."

logs:

0.278 Cloning into 'my-module'...
4.171 /bin/bash: line 1: pip: command not found

Why is this not working?

proud cometBOT
#

Project ID: c5ad221b-8b00-4b24-b8c9-eac5b00a9054

analog vapor
#

c5ad221b-8b00-4b24-b8c9-eac5b00a9054

vapid echo
#

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

#

make sure to include the “…” as well as that tells nixpacks to install the detected packages as well

vapid echo
#

@analog vapor for visibility ^

radiant pebble
#

the real question is, why are you having your build clone a repo instead of letting railway's infra do that for you?

analog vapor
#

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?

#

@radiant pebble 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

radiant pebble
#

attach your repo to the service

analog vapor
#

That's what I've done for the main app, but it has deps on 6 private modules

radiant pebble
#

Fair, this sounds like an absolute pain to do with nixpacks, i would highly recommend this be done with a Dockerfile

analog vapor
#

Thanks I will give it a go

analog vapor
#

@radiant pebble 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.

mystic cargo
analog vapor
#

nice, good to hear!

radiant pebble
#

yeah it's totally fine, but personally, I much prefer parallel

#

far far simpler

analog vapor
#

Thanks, how can I avoid this Dockerfile caching? This layers runs git clone & pip install on repo's I've made commits to

radiant pebble
#

set a service variable NO_CACHE to 1

analog vapor
#

@radiant pebble please send me friend request if you're interested in paid work (deploying docker-compose to Railway)