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

Latest opencv (4.7.0.68) introduces fatal backward compatibility issue with ZLIB. #765

Closed
4 tasks done
huntzhan opened this issue Dec 30, 2022 · 5 comments
Closed
4 tasks done
Labels

Comments

@huntzhan
Copy link

huntzhan commented Dec 30, 2022

System Information

OpenCV python version: 4.7.0.68
Operating System / Platform: quay.io/pypa/manylinux_2_24_x86_64
Python version: 3.8+
ZLIB version: 1.2.8

OpenCV python version: 4.7.0.68
Operating System / Platform: quay.io/pypa/manylinux2014
Python version: 3.8+
ZLIB version: 1.2.7

Detailed description

The latest opencv (4.7.0.68) requires ZLIB >= 1.2.9. This upgrade introduces fatal backward compatibility issue, since the dominant platforms like manylinux2014 and manylinux_2_24_x86_64 can't meet the requirement, especially the related wheels are shipped with platform tag manylinux2014_x86_64. As a consequence, running the latest opencv (4.7.0.68) on those platforms raises the version ZLIB_1.2.9 not found error.

Steps to reproduce

docker run --rm -it quay.io/pypa/manylinux2014_x86_64

/opt/python/cp38-cp38/bin/pip install opencv-python-headless
/opt/python/cp38-cp38/bin/python -c 'import cv2 as cv'
docker run --rm -it quay.io/pypa/manylinux_2_24_x86_64

/opt/python/cp38-cp38/bin/pip install opencv-python-headless
/opt/python/cp38-cp38/bin/python -c 'import cv2 as cv'

The log of pip:

[root@ca5e3a59f0c9 /]# /opt/python/cp38-cp38/bin/pip install opencv-python-headless
Collecting opencv-python-headless
  Downloading opencv_python_headless-4.7.0.68-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (49.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.2/49.2 MB 9.1 MB/s eta 0:00:00
Collecting numpy>=1.17.0
  Downloading numpy-1.24.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 9.8 MB/s eta 0:00:00
Installing collected packages: numpy, opencv-python-headless
Successfully installed numpy-1.24.1 opencv-python-headless-4.7.0.68

Example of the error:

root@7f7608188ff0:/# /opt/python/cp38-cp38/bin/python -c 'import cv2 as cv'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/python/cp38-cp38/lib/python3.8/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/opt/python/cp38-cp38/lib/python3.8/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/opt/python/cp38-cp38/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /opt/_internal/cpython-3.8.16/lib/python3.8/site-packages/cv2/../opencv_python_headless.libs/libpng16-186fce2e.so.16.37.0)

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
@huntzhan huntzhan added the bug label Dec 30, 2022
@rajkumars82
Copy link

I see the same exception in aws lambda workload
[ERROR] Runtime.ImportModuleError: Unable to import module 'app': /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /var/task/cv2/../opencv_python.libs/libpng16-186fce2e.so.16.37.0)
Traceback (most recent call last):

I reverted back opencv_python version to 4.6.0.66 in requirement.txt after the change no issues noticed.

shacklestone added a commit to google-deepmind/dm_robotics that referenced this issue Jan 3, 2023
See opencv/opencv-python#765.

PiperOrigin-RevId: 499218374
Change-Id: Ib39915dc7c9ddaec70f69e248103d3d198504ce4
@emezh
Copy link

emezh commented Jan 4, 2023

Same issue on CentOS 7.9.2009.

@dzienki
Copy link

dzienki commented Jan 5, 2023

What comand or library install ZLIB?

@luckyops
Copy link

I see the same exception in aws lambda workload [ERROR] Runtime.ImportModuleError: Unable to import module 'app': /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /var/task/cv2/../opencv_python.libs/libpng16-186fce2e.so.16.37.0) Traceback (most recent call last):

I reverted back opencv_python version to 4.6.0.66 in requirement.txt after the change no issues noticed.

work for me

asmorkalov added a commit that referenced this issue Jan 20, 2023
Roll back to manylinux version to presume binary compatibility.
Related changes: #715
Address:
- #765
- #772
anthony-chaudhary added a commit to diffgram/diffgram that referenced this issue Jan 24, 2023
anthony-chaudhary added a commit to diffgram/diffgram that referenced this issue Jan 24, 2023
* fix imports

* zlib issue

as per opencv/opencv-python#765

* Move to install info pattern

Some were already on there
Stripe is legacy
Much cleaner and better to have those out of the way and on install info

* Clean old comments

* Remove legacy file_difference

* Add ID for text relations, move curve info to curve

* move instance base into it's own thing

add geo types to lesson noise

* remove legacy file_comparison_mode

* Clean packet further

Now should only be returning if values exit or based on the type
code itself is still missing a bunch of classes but function should be cleaner now

* align

* clean

* Remove Geo stuff from default test, Add dedicated geo test

* add more data mocking and geo type

* Update test_export_generation.py

* Clean legacy items

fix float expecated

* Remove legacy

occluded is used in keypoints but is stored in nodes.occluded not on the instance itself!
`fan_made` is from old automl approach, but now should use `machine_made` which is the generic

`new_instance` file is legacy was just a play thing,
the xyz stuff is stored in `position_3d` etc

* Update test_export_generation.py

* Update test_export_generation.py
wat3rBro pushed a commit to wat3rBro/detectron2-1 that referenced this issue Jan 30, 2023
Summary:
Related issue: opencv/opencv-python#765

It seems that the fix won't add to the regular pypi release (https://pypi.org/project/opencv-python/#history), skip this version in our config.

Differential Revision: D42859319

fbshipit-source-id: 136727f359f8a141fbc6cc14713e2f65881db05b
facebook-github-bot pushed a commit to facebookresearch/detectron2 that referenced this issue Jan 31, 2023
Summary:
Pull Request resolved: #4760

Related issue: opencv/opencv-python#765

The newly released opencv 4.7.0.68 isn't BC compatible on CircleCI linux environment, although there were a fix but it seems that the fix won't add to the regular pypi release very soon (https://pypi.org/project/opencv-python/#history), skip this version in our config.

Reviewed By: tglik

Differential Revision: D42859319

fbshipit-source-id: 04dd155051733844c5ca7d79480aa65e006cab16
@asmorkalov
Copy link
Collaborator

Fixed in 4.7.0.70.

@asmorkalov asmorkalov unpinned this issue Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants