R
RunPod4mo ago
Hello

No module "runpod" found

Hi, I am trying to run a serverless runpod instance with a docker image. This is my dockerfile:
# Base image -> https://github.com/runpod/containers/blob/main/official-templates/base/Dockerfile
# DockerHub -> https://hub.docker.com/r/runpod/base/tags
FROM runpod/base:0.6.2-cuda12.2.0

# The base image comes with many system dependencies pre-installed to help you get started quickly.
# Please refer to the base image's Dockerfile for more information before adding additional dependencies.
# IMPORTANT: The base image overrides the default huggingface cache location.


# --- Optional: System dependencies ---
# COPY builder/setup.sh /setup.sh
# RUN /bin/bash /setup.sh && \
# rm /setup.sh


# Python dependencies
COPY builder/requirements.txt /requirements.txt
RUN python3.11 -m pip install --upgrade pip && \
python3.11 -m pip install --upgrade -r /requirements.txt --no-cache-dir && \
rm /requirements.txt

# NOTE: The base image comes with multiple Python versions pre-installed.
# It is reccommended to specify the version of Python when running your code.

# Add src files (Worker Template)
ADD src .

RUN python3.11 -m pip install runpod

CMD python3.11 -u /handler.py
# Base image -> https://github.com/runpod/containers/blob/main/official-templates/base/Dockerfile
# DockerHub -> https://hub.docker.com/r/runpod/base/tags
FROM runpod/base:0.6.2-cuda12.2.0

# The base image comes with many system dependencies pre-installed to help you get started quickly.
# Please refer to the base image's Dockerfile for more information before adding additional dependencies.
# IMPORTANT: The base image overrides the default huggingface cache location.


# --- Optional: System dependencies ---
# COPY builder/setup.sh /setup.sh
# RUN /bin/bash /setup.sh && \
# rm /setup.sh


# Python dependencies
COPY builder/requirements.txt /requirements.txt
RUN python3.11 -m pip install --upgrade pip && \
python3.11 -m pip install --upgrade -r /requirements.txt --no-cache-dir && \
rm /requirements.txt

# NOTE: The base image comes with multiple Python versions pre-installed.
# It is reccommended to specify the version of Python when running your code.

# Add src files (Worker Template)
ADD src .

RUN python3.11 -m pip install runpod

CMD python3.11 -u /handler.py
When the handler runs, import runpod errors out as ModuleNotFoundError: No module named 'runpod' Anyone experienced this before?
3 Replies
ashleyk
ashleyk4mo ago
Shouldn't be doing that because the 2nd last line of the Dockerfile is installing it
justin
justin4mo ago
I recommend to do a virtual env, Create and activate virtual environment RUN python3.10 -m venv /app/venv ENV PATH="/app/venv/bin:$PATH" https://github.com/justinwlin/runpodWhisperx/blob/master/Dockerfile Such as I do. Just reduces chances of weird python and package stuff
GitHub
runpodWhisperx/Dockerfile at master · justinwlin/runpodWhisperx
Runpod WhisperX Docker Container Repo. Contribute to justinwlin/runpodWhisperx development by creating an account on GitHub.
NERDDISCO
NERDDISCO4mo ago
What do you see on the CLI when you build the docker image? Especially when the command RUN python3.11 -m pip install runpod ran?