Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.3.0.38 does not ship with libGL.so #373

Closed
3 of 4 tasks
Domibor opened this issue Aug 11, 2020 · 4 comments
Closed
3 of 4 tasks

Version 4.3.0.38 does not ship with libGL.so #373

Domibor opened this issue Aug 11, 2020 · 4 comments

Comments

@Domibor
Copy link

Domibor commented Aug 11, 2020

Expected behaviour

Updating from 4.3.0.36 to 4.3.0.38 should miss system libraries.

Actual behaviour

import cv2 breaks.

(opencv) root@619f7f2a9b63:/tmp/body# python -c "import cv2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/envs/opencv/lib/python3.6/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
(opencv) root@619f7f2a9b63:/tmp/body# 

Steps to reproduce

Using a fresh python environment inside this container docker run -ti continuumio/miniconda3:4.7.12 /bin/bash:

conda create --name opencv python=3.6 pip=20 --yes
conda activate opencv

It works with previous release

(opencv) root@619f7f2a9b63:/tmp/body# pip install opencv-python==4.3.0.36
Collecting opencv-python==4.3.0.36
  Using cached opencv_python-4.3.0.36-cp36-cp36m-manylinux2014_x86_64.whl (43.7 MB)
Collecting numpy>=1.11.3
  Downloading numpy-1.19.1-cp36-cp36m-manylinux2010_x86_64.whl (14.5 MB)
     |████████████████████████████████| 14.5 MB 2.8 MB/s 
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.19.1 opencv-python-4.3.0.36
(opencv) root@619f7f2a9b63:/tmp/body# python -c "import cv2"
(opencv) root@619f7f2a9b63:/tmp/body# 

last release breaks:

(opencv) root@619f7f2a9b63:/tmp/body# pip install opencv-python==4.3.0.38
Collecting opencv-python==4.3.0.38
  Using cached opencv_python-4.3.0.38-cp36-cp36m-manylinux2014_x86_64.whl (49.3 MB)
Requirement already satisfied: numpy>=1.13.3 in /opt/conda/envs/opencv/lib/python3.6/site-packages (from opencv-python==4.3.0.38) (1.19.1)
Installing collected packages: opencv-python
  Attempting uninstall: opencv-python
    Found existing installation: opencv-python 4.3.0.36
    Uninstalling opencv-python-4.3.0.36:
      Successfully uninstalled opencv-python-4.3.0.36
Successfully installed opencv-python-4.3.0.38
(opencv) root@619f7f2a9b63:/tmp/body# python -c "import cv2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/envs/opencv/lib/python3.6/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
(opencv) root@619f7f2a9b63:/tmp/body# 
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
@skvark
Copy link
Member

skvark commented Aug 11, 2020

See: #370 (comment)

libGL.so is whitelisted by auditwheel. It will not be shipped with the wheels.

@skvark skvark closed this as completed Aug 11, 2020
@Yamini-DS
Copy link

GCP error

I tried to modify the docker file and made some changes in requirements and still couldn't know how to deploy without this error in GCP and locally it is working good. Please let me know if there are any solutions to it. Thanks.

@sergregory
Copy link
Collaborator

@Yamini-DS I believe you either should depend on opencv-python-headless instead of opencv-python (if your code is the only place where you have a dependency on opencv-python), or ensure that after all python packages installation steps you install opencv-python-headless (to rewrite the package - a hacky option), or install the required GUI stack to the docker image (probably, will take several hundreds of megabytes)

@tw-yshuang
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants