Multistage docker build with venv error: "ModuleNotFoundError: No module named 'flask'" #141
Unanswered
rosario-vandebron
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I am trying to build a multistage docker image starting from
tiangolo/meinheld-gunicorn:python3.9-alpine3.13-2024-03-11
. I've installed all my dependencies usingpip
andvirtualenv
. After all dependencies are installed I simply do in my dockerfilebut then when I try to run the container I see this error:
Looking at the interpreter used I've noticed that it is using the system python and not the venv one. Further investigation confirmed that gunicorn has been installed globally from your image.
Now the question is: Is there a way to use multistage build along with your image? Is there a way to tell which python interpreter the workers should use ? Or maybe I can do a multistage build without venv but I have no experience with it. Can you help?
Operating System
Linux
Operating System Details
Docker
Python Version
3.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions