opencv / opencv/opencv-python

how to build debug opencv

Open
#1,129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I followed the instructions in link A and installed scikit build and numpy, then ran python setup. py bdistw_heel -- build type=Debug. First, it would report an error that it couldn't find the libs/python311-d. lib file, but I'm sure it exists in my python. It always defaults to finding the release version libs/python311.lib. In order to find it,I tried many methods and finally added :

'$lib-dbg='D:/Program/miniconda 3/env/opencv-build/libs/python311-d.lib' 
$env: MAKE-ARGS="-DPYTHON3_LIBRRY=$lib-dbg -DPython3_LIBRRY=$lib-dbg" 

This command forces DPYTHON3_LIBRRY to be python311-d.lib '
This command is mandatory for python311-d. lib 'to be found. Then, run python setup. py bdistw_heel -- build type=Debug to find python311-d. lib
This is very strange. Is it designed this way? Do you need to manually modify this path yourself?

  • build type=Debug, won't he automatically find this path

Then all of these passed smoothly and reported an error:

Traceback (most recent call last):
File "D:\github\opencv-python\opencv-python\setup.py", line 537, in <module>
main()
File "D:\github\opencv-python\opencv-python\setup.py", line 266, in main
setup(
File "D:\Myprogram\miniconda3\envs\opencv_build\Lib\site-packages\skbuild\setuptools_wrap.py", line 700, in setup
_classify_installed_files(
File "D:\github\opencv-python\opencv-python\setup.py", line 450, in _classify_installed_files_override
raise Exception("Not found: '%s'" % relpath_re)
Exception: Not found: 'python/cv2/python-3.*/cv2.*'

Check if the directory I generated is
_stkbuild \ win32-3.11 \ make-build \ lib \ python3 \ debug \ cv2.pyd, cv2.pdb

Is it because there are no sub version numbers generated, so none of them are available? Why does it automatically generate folders that it cannot read?

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

Start with the manual debug-build instructions linked in the issue and inspect setup.py, especially the Python library configuration and _classify_installed_files_override around line 450. Reproduce the Windows Python 3.11 Debug build, then compare the generated _skbuild\win32-3.11\make-build\lib\python3\debug\cv2.pyd path with the path the classifier expects. Done means the documented debug build completes without the missing-file exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
opencv, python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.