Opencv-python: Cannot install opencv-contrib-python from Alpine Linux

Created on 3 Mar 2018  路  3Comments  路  Source: opencv/opencv-python

Actual behaviour

Could not find a version that satisfies the requirement opencv-contrib-python (from -r /repo/requirements.txt (line 2)) (from versions: )
Cleaning up...
Removing source in /tmp/pip-build-7x79cyfg/numpy
No matching distribution found for opencv-contrib-python (from -r /repo/requirements.txt (line 2))

Steps to reproduce

I tried to download opencv-contrib-python package from Alpine Linux Docker Image but failed.

  • example code : pip install opencv-contrib-python
  • operating system : https://hub.docker.com/_/alpine/
  • architecture (e.g. x86) : x86
  • opencv-python version : didn't work for any. specifically tried for 3.4.0.12

Most helpful comment

Note that opencv-python also fails to install with pip on Alpine. Updating pip does not solve the problem. I believe that the problem is that Alpine does not appear to be supported by manylinux. Would you be open to building opencv-python specifically for alpine as alpine is often used for Docker containers?

All 3 comments

Your pip is most likely too old. Try pip install --upgrade pip and run pip install opencv-contrib-python again.

Note that opencv-python also fails to install with pip on Alpine. Updating pip does not solve the problem. I believe that the problem is that Alpine does not appear to be supported by manylinux. Would you be open to building opencv-python specifically for alpine as alpine is often used for Docker containers?

I completely forgot that Alpine Linux is based on musl libc and not on GNU libc and thus it's not a GNU/Linux distribution. Manylinux supports only GNU/Linux. Pip and other python packaging tools do not provide tools to build or distribute binary packages for musl based Linux distributions. I'm afraid I can't provide such packages.

I recommend to build everything from scratch or to use the package manager of Alpine to install python packages.

You can use this hack https://github.com/pypa/pip/issues/3969 to force the installation of manylinux packages, but there are no guarantees that the packages work: ABI differences, version differences etc. will most likely cause major issues at some point.

Was this page helpful?
0 / 5 - 0 ratings