build error running python activating venv and installing requirements.txt
beballod
PROOP

a year ago

Trying to fix this error. Thanks for any pointers.

Here's the command: "python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 127

And error code: /bin/bash: line 1: python: command not found

Solved$10 Bounty

Pinned Solution

a year ago

This probably means that python is not installed or not in your path.

Depending on your image maybe python is installed as python3 so you may try with

python3 -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt or install python-is-python3

Try to find out with which python and If python is installed just add it to your path export PATH="/path/to/python/bin:$PATH"

I would also recommend better using UV to run python within containers, is super easy and cool.

FROM python:3.12-slim-bookworm

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

Then uv run python -m etc.

2 Replies

a year ago

This probably means that python is not installed or not in your path.

Depending on your image maybe python is installed as python3 so you may try with

python3 -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt or install python-is-python3

Try to find out with which python and If python is installed just add it to your path export PATH="/path/to/python/bin:$PATH"

I would also recommend better using UV to run python within containers, is super easy and cool.

FROM python:3.12-slim-bookworm

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

Then uv run python -m etc.


roicort

This probably means that python is not installed or not in your path. Depending on your image maybe python is installed as python3 so you may try with `python3 -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt or install python-is-python3` Try to find out with which python and If python is installed just add it to your path `export PATH="/path/to/python/bin:$PATH"` I would also recommend better using UV to run python within containers, is super easy and cool. `FROM python:3.12-slim-bookworm ` `COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/` Then `uv run python -m` etc.

beballod
PROOP

a year ago

This pointed me in the right direction and it's working now...thanks for the quick reply!

I'll check out UV.


Status changed to Solved chandrika 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...