Skip to content

Building opencv-python 4.6.0.66 based on an existing OpenCV 4.6.0 installation with CUDA support #731

@samfux84

Description

@samfux84

Expected behaviour

module load gcc/8.2.0 opencv/4.6.0 python_gpu/3.10.4

pip install --user --upgrade --no-binary :all: opencv_python==4.6.0.66

Should build opencv-python using the provided opencv/4.6.0 installation that is compiled with GPU support

Actual behaviour

I have no idea what is actually happening and why the Python bindings for my OpenCV 4.6.0 are not built. I have all python dependencies available and an OpenCV 4.6.0 installation. Pip tries to install many packages that are already present in my Python 3.10.4 installation:

  • setuptools 59.2.0 (I have 58.1.0)
  • wheel 0.37.0 (I have 0.37.1)
  • pip 22.2.2 (I have 22.1.2)
  • numpy 1.21.2 (I have 1.22.4)
[sfux@eu-login-28 ~]$ pip install --upgrade --user --no-binary :all: opencv-python==4.6.0.66
Collecting opencv-python==4.6.0.66
  Downloading opencv-python-4.6.0.66.tar.gz (90.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.3/90.3 MB 31.7 MB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [231 lines of output]
      Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
      Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "darwin" and platform_machine == "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.9" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Collecting setuptools==59.2.0
        Downloading setuptools-59.2.0.tar.gz (2.3 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 30.1 MB/s eta 0:00:00
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting wheel==0.37.0
        Downloading wheel-0.37.0.tar.gz (65 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.7/65.7 kB 11.5 MB/s eta 0:00:00
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting cmake>=3.1
        Downloading cmake-3.24.1.1.tar.gz (33 kB)
        Installing build dependencies: started
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting pip
        Downloading pip-22.2.2.tar.gz (2.0 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 91.2 MB/s eta 0:00:00
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting scikit-build>=0.13.2
        Using cached scikit-build-0.15.0.tar.gz (268 kB)
        Installing build dependencies: started
        Installing build dependencies: still running...
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting numpy==1.21.2
        Downloading numpy-1.21.2.zip (10.3 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.3/10.3 MB 111.3 MB/s eta 0:00:00
        Installing build dependencies: started
        Installing build dependencies: still running...
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting distro
        Using cached distro-1.7.0.tar.gz (58 kB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting packaging
        Using cached packaging-21.3.tar.gz (84 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting pyparsing!=3.0.5,>=2.0.2
        Using cached pyparsing-3.0.9.tar.gz (2.0 MB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Skipping wheel build for wheel, due to binaries being disabled for it.
      Skipping wheel build for distro, due to binaries being disabled for it.
      Building wheels for collected packages: numpy, cmake, pip, scikit-build, packaging, pyparsing, setuptools
        Building wheel for numpy (pyproject.toml): started
        Building wheel for numpy (pyproject.toml): still running...
        Building wheel for numpy (pyproject.toml): still running...
        Building wheel for numpy (pyproject.toml): still running...
        Building wheel for numpy (pyproject.toml): still running...
        Building wheel for numpy (pyproject.toml): finished with status 'done'
        Created wheel for numpy: filename=numpy-1.21.2-cp310-cp310-linux_x86_64.whl size=20180798 sha256=05d29341dfee7b1f2560d8f05af94d8d1f3d4e79fc05aefeab92b4205a3c2810
        Stored in directory: /cluster/home/sfux/.cache/pip/wheels/55/ca/9f/48d8bbedba076d0949e6d329c6aad3705267c63cc38521852d
        Building wheel for cmake (pyproject.toml): started
        Building wheel for cmake (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Building wheel for cmake (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [108 lines of output]
            Not searching for unused variables given on the command line.
            CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
            -- Configuring incomplete, errors occurred!
            Not searching for unused variables given on the command line.
            -- The C compiler identification is GNU 8.2.0
            -- Check for working C compiler: /cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/gcc
            -- Check for working C compiler: /cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/gcc -- works
            -- Detecting C compiler ABI info
            -- Detecting C compiler ABI info - done
            -- The CXX compiler identification is GNU 8.2.0
            -- Check for working CXX compiler: /cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/g++
            -- Check for working CXX compiler: /cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/g++ -- works
            -- Detecting CXX compiler ABI info
            -- Detecting CXX compiler ABI info - done
            -- Configuring done
            -- Generating done
            -- Build files have been written to: /tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f/_cmake_test_compile/build
            CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
              CMake 3.6 or higher is required.  You are running version 2.8.12.2


            -- Configuring incomplete, errors occurred!
              File "/tmp/pip-build-env-enm7gjte/overlay/lib64/python3.10/site-packages/skbuild/setuptools_wrap.py", line 637, in setup
                env = cmkr.configure(
              File "/tmp/pip-build-env-enm7gjte/overlay/lib64/python3.10/site-packages/skbuild/cmaker.py", line 328, in configure
                raise SKBuildError(


            --------------------------------------------------------------------------------
            -- Trying "Ninja" generator
            --------------------------------
            ---------------------------
            ----------------------
            -----------------
            ------------
            -------
            --
            --
            -------
            ------------
            -----------------
            ----------------------
            ---------------------------
            --------------------------------
            -- Trying "Ninja" generator - failure
            --------------------------------------------------------------------------------



            --------------------------------------------------------------------------------
            -- Trying "Unix Makefiles" generator
            --------------------------------
            ---------------------------
            ----------------------
            -----------------
            ------------
            -------
            --
            --
            -------
            ------------
            -----------------
            ----------------------
            ---------------------------
            --------------------------------
            -- Trying "Unix Makefiles" generator - success
            --------------------------------------------------------------------------------

            Configuring Project
              Working directory:
                /tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f/_skbuild/linux-x86_64-3.10/cmake-build
              Command:
                cmake /tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f/_skbuild/linux-x86_64-3.10/cmake-install/src/cmake/data -DPYTHON_VERSION_STRING:STRING=3.10.4 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-enm7gjte/overlay/lib64/python3.10/site-packages/skbuild/resources/cmake -DPython3_EXECUTABLE:FILEPATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/bin/python -DPython3_INCLUDE_DIR:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/include/python3.10 -DPython3_LIBRARY:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/lib64/libpython3.10.so -DPython_EXECUTABLE:FILEPATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/bin/python -DPython_INCLUDE_DIR:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/include/python3.10 -DPython_LIBRARY:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/lib64/libpython3.10.so -DPYTHON_EXECUTABLE:FILEPATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/bin/python -DPYTHON_INCLUDE_DIR:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/include/python3.10 -DPYTHON_LIBRARY:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/lib64/libpython3.10.so -DCMAKE_BUILD_TYPE:STRING=Release

            Traceback (most recent call last):


                =============================DEBUG ASSISTANCE=============================
                If you are seeing a compilation error please try the following steps to
                successfully install cmake:
                1) Upgrade to the latest pip and try again. This will fix errors for most
                   users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
                2) If on Linux, with glibc < 2.12, you can set PIP_ONLY_BINARY=cmake in
                   order to retrieve the last manylinux1 compatible wheel.
                3) If on Linux, with glibc < 2.12, you can cap "cmake<3.23" in your
                   requirements in order to retrieve the last manylinux1 compatible wheel.
                4) Open an issue with the debug information that follows at
                   https://github.com/scikit-build/cmake-python-distributions/issues

                Python: 3.10.4
                platform: Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-glibc2.17
                glibc: glibc 2.17
                machine: x86_64
                bits: 64
                pip: n/a
                setuptools: 65.3.0
                scikit-build: 0.15.0
                PEP517_BUILD_BACKEND=setuptools.build_meta
                =============================DEBUG ASSISTANCE=============================

            An error occurred while configuring with CMake.
              Command:
                cmake /tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f/_skbuild/linux-x86_64-3.10/cmake-install/src/cmake/data -DPYTHON_VERSION_STRING:STRING=3.10.4 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-enm7gjte/overlay/lib64/python3.10/site-packages/skbuild/resources/cmake -DPython3_EXECUTABLE:FILEPATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/bin/python -DPython3_INCLUDE_DIR:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/include/python3.10 -DPython3_LIBRARY:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/lib64/libpython3.10.so -DPython_EXECUTABLE:FILEPATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/bin/python -DPython_INCLUDE_DIR:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/include/python3.10 -DPython_LIBRARY:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/lib64/libpython3.10.so -DPYTHON_EXECUTABLE:FILEPATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/bin/python -DPYTHON_INCLUDE_DIR:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/include/python3.10 -DPYTHON_LIBRARY:PATH=/cluster/apps/nss/gcc-8.2.0/python/3.10.4/x86_64/lib64/libpython3.10.so -DCMAKE_BUILD_TYPE:STRING=Release
              Source directory:
                /tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f
              Working directory:
                /tmp/pip-install-gbwqmi4l/cmake_da2648a318224554bb9abdc4cc18d50f/_skbuild/linux-x86_64-3.10/cmake-build
            Please see CMake's output for more information.
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for cmake
        Building wheel for pip (pyproject.toml): started
        Building wheel for pip (pyproject.toml): finished with status 'done'
        Created wheel for pip: filename=pip-22.2.2-py3-none-any.whl size=2044709 sha256=1d73c9ea2cdf7cb02c75d5654fdc02c048b806b6e062615b504b59bdad7cf0a1
        Stored in directory: /cluster/home/sfux/.cache/pip/wheels/ff/35/7f/abadbddb05f0c270b36e958f0e933b33412ab5bdc37d894987
        Building wheel for scikit-build (pyproject.toml): started
        Building wheel for scikit-build (pyproject.toml): finished with status 'done'
        Created wheel for scikit-build: filename=scikit_build-0.15.0-py2.py3-none-any.whl size=77495 sha256=e682c72628234da3c1caf2c735d5b2d2f353786562185d0536e8f16e7d5c9bf7
        Stored in directory: /cluster/home/sfux/.cache/pip/wheels/8c/9c/b5/f89f64907c0df01d287a19a773914c3a6849ed3e80e8a75bcb
        Building wheel for packaging (pyproject.toml): started
        Building wheel for packaging (pyproject.toml): finished with status 'done'
        Created wheel for packaging: filename=packaging-21.3-py3-none-any.whl size=40735 sha256=fe5ed8fd6203bce346bbb4c0ad27cf242f9eb3f48f5653ca768cd2426d87cbdf
        Stored in directory: /cluster/home/sfux/.cache/pip/wheels/9d/1e/77/05abacaf7e82c8ce47398a54d17dd8251e2d8ae5f297101773
        Building wheel for pyparsing (pyproject.toml): started
        Building wheel for pyparsing (pyproject.toml): finished with status 'done'
        Created wheel for pyparsing: filename=pyparsing-3.0.9-py3-none-any.whl size=98338 sha256=18eee41d6820e162bb7354b364a616866291bdeb878ff479de67b2eefef78a86
        Stored in directory: /cluster/home/sfux/.cache/pip/wheels/50/41/74/aed38ddc97f90ce428d253a7032f9413545e4d2fe3a403afcc
        Building wheel for setuptools (pyproject.toml): started
        Building wheel for setuptools (pyproject.toml): finished with status 'done'
        Created wheel for setuptools: filename=setuptools-59.2.0-py3-none-any.whl size=952018 sha256=ee8f2cc6de5460123cb115c0845f9f7960f59fee5675a3b5aa487099b45d9f45
        Stored in directory: /cluster/home/sfux/.cache/pip/wheels/af/fd/63/e3329476c0f0ce407211cf7e655239c0832064e0c906c369ff
      Successfully built numpy pip scikit-build packaging pyparsing setuptools
      Failed to build cmake
      ERROR: Could not build wheels for cmake, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
[sfux@eu-login-28 ~]$

Steps to reproduce

listed above

  • operating system: CentOS 7.9
  • architecture (e.g. x86): x86_64
  • opencv-python version: 4.6.0.66
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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions