Exception when importing Python's CV2 lib
Cv2 was added to the list of libraries that are installed with one name, but used with another. However, it still doesn't work.
14 Replies
It's not a problem with import. It is missing libgl dependency. Install it and it should work
You need to add a shared lib to the image
Pardon my stupidity, but can you tell me how to do that? AI wasn't of any help
You have to self host and you have to either use the
INIT_SCRIPT
env variable to run apt install
or bake a new image that extends the original image from Windmill and installs the lib.^
In my case I use the docker compose file with build directive - it references docker build folder. That in turn takes windmill image and adds needed changes (certificates in my case). You can do the same, but with libgl.
See this link for a bit more description how this works:
https://stackoverflow.com/a/45173812
Stack Overflow
Docker-compose.yml file that builds a base image, then children bas...
For clarification, when I say base image, I mean the parent image that has all the common configurations, so that the children based on it don't need to download the dependencies individually.
Fro...
thank you!
would it be too presumptuous of me to ask you to share a sanitized version of the Dockerfile you use in this process?
I'm fairly new to Docker, and sometimes it's hard to wrap my mind around these things
@shoomow you probably could benefit from INIT_SCRIPT
Preinstall Binaries | Windmill
Workers in Windmill can preinstall binaries. This allows them to execute these binaries in subprocesses or directly within bash. While some common binaries like npm, aws-cli, kubectl, and helm are already present in the standard images, you can add more by extending the base image of Windmill.
INIT_SCRIPT="apt-get ..." pass as env variable
I guess I missed this article somehow. Thanks!
It seems the Init script is much better for your use case. I will supply dockerfiles if init script won't work for you
INIT_SCRIPT seems to be simple for ee. "pass it as env variable" - pass where? I don't know.
So I tried the dockerfile way. I created a Dockerfile with following contents:
Then I changed docker-compose file like so:
Then I recieved an Exception when trying to run
docker compose up -d
the env variables are passed in environment: block of your docker-compose