Python would not build
alexsherstinsky
PROOP

4 months ago

Hi, I am sorry if this was aksed many times -- I still cannot get the build working using python.

I added .python-version with 3.11.11
RAILPACK isn't installing Python with pip
The build logs show /usr/bin/python3: No module named pip
The earlier logs showed mise python@3.13.9 ✓ installed, so RAILPACK can install Python, but something is preventing it now.

Can someone please help me figure out what I am doing wrong? Thanks so much.

$10 Bounty

5 Replies

alexsherstinsky
PROOP

4 months ago

I must be doing something wrong, because this is just a simple python project. Should I instead be creating docker-compose.yml in my top repo directory?


4 months ago

Hey, can you elaborate more on installing Python with pip? I suppose that you have an issue with installing dependencies?


4 months ago

Hey some questions I would have about this; do you have a requirements.txt file in the project root? if you do, usually railpack is pretty solid about building out from that.

If you do have a requirements.txt, and it's still not working I would probably suggest you

  • setup a dockerfile for your app

  • confirm that your container can build and run on your dev machine

  • push the dockerfile to GitHub so Railway can see it

  • go into your service settings and set your builder to Dockerfile, and choose the dockerfile in your service settings OR set it via environment variables.

Railway makes it really easy to get a docker image building/running: see this doc for a writeup on that: https://docs.railway.com/guides/dockerfiles


alexsherstinsky
PROOP

4 months ago

yes, it was all sorts of dependencies. I finally got it working -- but it seems that my way is incredibly unnecessarily complex, yet it is the only way out I found:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py --break-system-packages && cd myplatformdir && python3 -m pip install -r requirements.txt --break-system-packages && python3 -m pip install . --break-system-packages && cd ../.. && python3 -m pip install myplatformdir myapplicationsdir --break-system-packages

I wish there was a simpler solution, which would run faster (this was takes at least three minutes).


4 months ago

wave emoji I help with railpack development!

What does your project structure look like? ls -la

I just tried setting up a py 3.11.11 project with uv and it worked fine. But I'm guessing you are using pip directly with a requirements.txt? Could you help me understand the python tooling you are using here?


Loading...