opencv / opencv/opencv-python

Manual build using provided Docker images fails

Open
#913 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Description

Expected behaviour

I'm trying to build opencv-python-headless for Python 3.10 with only several modules (core, imgproc, videoio) using the provided Docker image with OpenCV dependencies, and using the provided instructions for manual builds.

I spin up the following Docker container quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231006 and execute the following code in the container shell:

cd ~
git clone --recursive https://github.com/opencv/opencv-python.git
cd ~/opencv-python
git checkout -b 78
export CMAKE_ARGS="-DBUILD_LIST=core,imgproc,videoio" ENABLE_HEADLESS=1
python3.10 -m pip wheel . --verbose > out.txt 2>&1
Actual behaviour

The build fails with the error below and the full output of pip wheel . --verbose can be viewed in out.txt.

  Copying files from CMake output
  Traceback (most recent call last):
    File "/opt/_internal/cpython-3.10.13/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/opt/_internal/cpython-3.10.13/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/opt/_internal/cpython-3.10.13/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-build-env-v332t_75/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 230, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/tmp/pip-build-env-v332t_75/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-v332t_75/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 267, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/tmp/pip-build-env-v332t_75/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 535, in <module>
      main()
    File "setup.py", line 267, in main
      skbuild.setup(
    File "/tmp/pip-build-env-v332t_75/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 706, in setup
      _classify_installed_files(
    File "setup.py", line 409, in _classify_installed_files_override
      with open(config_py, 'w') as opencv_init_config:
  FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-x86_64-3.10/cmake-install/python/cv2/config-3.py'
  error: subprocess-exited-with-error
  
  × Building wheel for opencv-python-headless (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

I also tried adding -DPYTHON3_LIMITED_API=ON to CMAKE_ARGS but the result is the same.

And I noticed that there is no folder python in _skbuild/linux-x86_64-3.10/cmake-install, let alone any config files.

Steps to reproduce
  • see the code above
  • Windows 10 using Docker Desktop 4.25.0
  • manylinux2014-x86-64
  • opencv-python-headless 4.8.1.78

Since the error is related to scikit-build, maybe @henryiii could also help? Thanks a lot to everyone! 🙏

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the documented manual build in the provided Docker image using the shown CMAKE_ARGS and pip wheel command. Start with setup.py, especially _classify_installed_files_override, and inspect the _skbuild/linux-x86_64-3.10/cmake-install output; done means the selected core, imgproc, and videoio modules produce a wheel successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.