Problem with venv
Hi,
This is my handler.py file:
when entrypoint.sh has this code: it works fine and gives
Solution:Jump to solution
Finally works, thanks for all the help! The issue was the base image that was different.
18 Replies
If it has this code:
it gives
Any idea where it goes wrong? I understood that runpod already chose the mount path as "runpod-volume", that is why I did "rm -rf /workspace && ln -s /runpod-volume /workspace". Also, when executing pip list in a pod, ade with the same network volume, no errors.
Does your docker image for your serverless worker have the same Python version as the one you used to create the venv?
I think it is, this is the docker image used to create the venv (i made a pod with this templatte and manually created the venv): and this is the one to make serverless endpoint:
Where are you from @Daan ? Netherlands?
I live in Belgium 🙂
Ah, thats why I can read it, I can't really understand Dutch 😆
Is the Docker image public?
Or is it private?
it is private, but I can make it public, one second
daana2003/orca-gpu-runner:no_vim_10
daana2003/orca-gpu-runner:serverless_60
Is the first one for GPU cloud and the second one for serverless?
Yes, indeed
Made the first one to manually make a .venv in worspace directory
I am getting this error with the first image:
strange, I didn't had that error. I will retry it
Maybe your .venv folder already existed in /workspace
oh, no it is because you do not use my network volume.
I use a network volume that is mounted in /workspace
Yeah seems like it expects certain things to already exist on the network volume
Yes indeed, so I made manually a venv and app.sh file. My script works fine then if I execute it in the GPU. But in the serverless endpoint, with the other image it goes wrong. I really can't understand why works, but then if i change ls by "pip list" it gives the error that pip is not found...
Yeah there seems to be an issue with the venv, which sometimes happens when the python versions are not the same
I can try to add "FROM python:3.11" to the dockerfile for teh sereverless endpoint,and delete "RUN python3.11 -m pip install --upgrade pip", then it certainly would be the same version, right?
Although I would exspect both images use python3.11 with the provided code
Solution
Finally works, thanks for all the help! The issue was the base image that was different.