[Python] pyinstaller + docker + openCV

Discussão em 'Python' iniciado por Stack, Janeiro 29, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to use pyinstaller to package a simple python script that imports cv2 module and all this should be done inside a docker container (this is part of a Gitlab CI/CD pipeline).

    I think I am doing this right in the right order, i.e.

    • start a docker python image,
    • then I can run apt-get install -y python3-opencv
    • pip install opencv-python
    • pip install pyinstaller
    • pyinstaller -F sample.py

    sample.py can be

    import cv2
    print("hello")


    When I run the resulting executable I get the error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory

    I've tried locating this library and adding to --paths option for pyinstaller but iwht no luck. Any help is appreciated

    Continue reading...

Compartilhe esta Página