<p dir="auto">After successfully install OpenCV 4.5.5 from sources, the Python3 bindings is broken:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ pkg-config --modversion opencv4
4.5.5
$ python3 -c &quot;import cv2; print(cv2.__version__)&quot;
Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
ModuleNotFoundError: No module named 'cv2'"><pre class="notranslate">$ pkg-config --modversion opencv4
4.5.5
$ python3 -c <span class="pl-s"><span class="pl-pds">"</span>import cv2; print(cv2.__version__)<span class="pl-pds">"</span></span>
Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>&lt;string&gt;<span class="pl-pds">"</span></span>, line 1, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
ModuleNotFoundError: No module named <span class="pl-s"><span class="pl-pds">'</span>cv2<span class="pl-pds">'</span></span></pre></div>
<p dir="auto">If I use version 4.5.4, python bindings are available as expected:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ git checkout 4.5.4"><pre class="notranslate">$ git checkout 4.5.4</pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ python3 -c &quot;import cv2; print(cv2.__version__)&quot;
4.5.4"><pre class="notranslate">$ python3 -c <span class="pl-s"><span class="pl-pds">"</span>import cv2; print(cv2.__version__)<span class="pl-pds">"</span></span>
4.5.4</pre></div>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 4.5.5 Nighty build</li>
<li>Operating System / Platform =&gt; Ubuntu 20.04.3 LTS</li>
<li>Compiler =&gt; gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<h5 dir="auto">Steps to reproduce</h5>
<ol start="0" dir="auto">
<li>update the system</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ sudo apt update
$ sudo apt upgrade"><pre class="notranslate">$ sudo apt update
$ sudo apt upgrade</pre></div>
<ol dir="auto">
<li>install dependencies:</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ sudo apt install build-essential cmake git pkg-config libgtk-3-dev \
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
    libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
    gfortran openexr libatlas-base-dev python3-dev python3-numpy \
    libtbb2 libtbb-dev libdc1394-22-dev v4l-utils"><pre class="notranslate">$ sudo apt install build-essential cmake git pkg-config libgtk-3-dev \
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
    libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
    gfortran openexr libatlas-base-dev python3-dev python3-numpy \
    libtbb2 libtbb-dev libdc1394-22-dev v4l-utils</pre></div>
<ol start="2" dir="auto">
<li>clone repos</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ mkdir ~/opencv_build &amp;&amp; cd ~/opencv_build

$ git clone https://github.com/opencv/opencv_contrib.git
$ cd opencv_contrib
$ cd ..

$ git clone https://github.com/opencv/opencv.git
$ cd opencv"><pre class="notranslate">$ mkdir <span class="pl-k">~</span>/opencv_build <span class="pl-k">&amp;&amp;</span> <span class="pl-c1">cd</span> <span class="pl-k">~</span>/opencv_build

$ git clone https://github.com/opencv/opencv_contrib.git
$ <span class="pl-c1">cd</span> opencv_contrib
$ <span class="pl-c1">cd</span> ..

$ git clone https://github.com/opencv/opencv.git
$ <span class="pl-c1">cd</span> opencv</pre></div>
<ol start="3" dir="auto">
<li>Checking last commit:</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ git log -1
commit 7f6dcc27458757f36491842b2e3cc5770d526b25 (HEAD -&gt; 4.x, origin/master, origin/HEAD, origin/4.x)
Merge: f2d5d6d24e 5ba9a089e1
Author: Alexander Alekhin &lt;alexander.a.alekhin@gmail.com&gt;
Date:   Tue Jan 18 09:55:13 2022 +0000

    Merge pull request #21467 from alalek:issue_21448"><pre class="notranslate">$ git log -1
commit 7f6dcc27458757f36491842b2e3cc5770d526b25 (HEAD -<span class="pl-k">&gt;</span> 4.x, origin/master, origin/HEAD, origin/4.x)
Merge: f2d5d6d24e 5ba9a089e1
Author: Alexander Alekhin <span class="pl-k">&lt;</span>alexander.a.alekhin@gmail.com<span class="pl-k">&gt;</span>
Date:   Tue Jan 18 09:55:13 2022 +0000

    Merge pull request <span class="pl-c"><span class="pl-c">#</span>21467 from alalek:issue_21448</span></pre></div>
<ol start="4" dir="auto">
<li>build</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ mkdir build &amp;&amp; cd build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D INSTALL_C_EXAMPLES=OFF \
    -D INSTALL_PYTHON_EXAMPLES=OFF \
    -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
    -D OPENCV_GENERATE_PKGCONFIG=ON \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
    -D BUILD_EXAMPLES=OFF ..

$ make -j4

$ sudo make install
"><pre class="notranslate">$ mkdir build <span class="pl-k">&amp;&amp;</span> <span class="pl-c1">cd</span> build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D INSTALL_C_EXAMPLES=OFF \
    -D INSTALL_PYTHON_EXAMPLES=OFF \
    -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
    -D OPENCV_GENERATE_PKGCONFIG=ON \
    -D OPENCV_EXTRA_MODULES_PATH=<span class="pl-k">~</span>/opencv_build/opencv_contrib/modules \
    -D BUILD_EXAMPLES=OFF ..

$ make -j4

$ sudo make install
</pre></div>
<ol start="5" dir="auto">
<li>Check install</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ pkg-config --modversion opencv4
4.5.5
$ python3 -c &quot;import cv2; print(cv2.__version__)&quot;
Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
ModuleNotFoundError: No module named 'cv2'
$"><pre class="notranslate">$ pkg-config --modversion opencv4
4.5.5
$ python3 -c <span class="pl-s"><span class="pl-pds">"</span>import cv2; print(cv2.__version__)<span class="pl-pds">"</span></span>
Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>&lt;string&gt;<span class="pl-pds">"</span></span>, line 1, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
ModuleNotFoundError: No module named <span class="pl-s"><span class="pl-pds">'</span>cv2<span class="pl-pds">'</span></span>
$</pre></div>
<p dir="auto">PS.: output of cmake is:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
&gt;     -D CMAKE_INSTALL_PREFIX=/usr/local \
&gt;     -D INSTALL_C_EXAMPLES=OFF \
&gt;     -D INSTALL_PYTHON_EXAMPLES=OFF \
&gt;     -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
&gt;     -D OPENCV_GENERATE_PKGCONFIG=ON \
&gt;     -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
&gt;     -D BUILD_EXAMPLES=OFF ..
-- Detected processor: x86_64
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version &quot;2.7&quot;)
-- Looking for ccache - not found
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version &quot;1.2.11&quot;, minimum required is &quot;1.2.3&quot;) 
Cleaning INTERNAL cached variable: WEBP_LIBRARY
Cleaning INTERNAL cached variable: WEBP_INCLUDE_DIR
-- Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version &gt;= 2.3.1). OpenJPEG will be built from sources
-- OpenJPEG: VERSION = 2.4.0, BUILD = opencv-4.5.5-dev-openjp2-2.4.0
-- OpenJPEG libraries will be built from sources: libopenjp2 (version &quot;2.4.0&quot;)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version &quot;1.2.11&quot;) 
-- libva: missing va.h header (VA_INCLUDE_DIR)
-- found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold]
-- at: /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
-- found Intel IPP Integration Wrappers sources: 2020.0.0
-- at: /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR) 
-- A library with LAPACK API found.
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Checking for module 'gtk+-2.0'
--   No package 'gtk+-2.0' found
-- Checking for module 'libavresample'
--   No package 'libavresample' found
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-audio-1.0'
--   No package 'gstreamer-audio-1.0' found
-- Module opencv_alphamat disabled because the following dependencies are not found: Eigen
-- freetype2:   YES (ver 23.1.17)
-- harfbuzz:    YES (ver 2.6.4)
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version &quot;&quot;)
-- Julia not found. Not compiling Julia Bindings. 
-- Module opencv_ovis disabled because OGRE3D was not found
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
-- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
-- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
-- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
-- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
-- Checking for module 'tesseract'
--   No package 'tesseract' found
-- Tesseract:   NO
-- Allocator metrics storage type: 'long long'
-- Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': /home/debugger/opencv_build/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
-- opencv_dnn: filter out cuda4dnn source code
-- Excluding from source files list: &lt;BUILD&gt;/modules/dnn/layers/layers_common.rvv.cpp
-- imgcodecs: OpenEXR codec is disabled in runtime. Details: https://github.com/opencv/opencv/issues/21326
-- highgui: using builtin backend: GTK3
-- rgbd: Eigen support is disabled. Eigen is Required for Posegraph optimization
-- Found 'misc' Python modules from /home/debugger/opencv_build/opencv/modules/python/package/extra_modules
-- Found 'mat_wrapper;utils' Python modules from /home/debugger/opencv_build/opencv/modules/core/misc/python/package
-- Found 'gapi' Python modules from /home/debugger/opencv_build/opencv/modules/gapi/misc/python/package
-- Found 'misc' Python modules from /home/debugger/opencv_build/opencv/modules/python/package/extra_modules
-- Found 'mat_wrapper;utils' Python modules from /home/debugger/opencv_build/opencv/modules/core/misc/python/package
-- Found 'gapi' Python modules from /home/debugger/opencv_build/opencv/modules/gapi/misc/python/package
-- 
-- General configuration for OpenCV 4.5.5-dev =====================================
--   Version control:               4.5.5-57-g7f6dcc2745
-- 
--   Extra modules:
--     Location (extra):            /home/debugger/opencv_build/opencv_contrib/modules
--     Version control (extra):     4.5.5-5-gbb3048d5
-- 
--   Platform:
--     Timestamp:                   2022-01-18T13:18:57Z
--     Host:                        Linux 5.13.0-25-generic x86_64
--     CMake:                       3.16.3
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               RELEASE
-- 
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (16 files):         + SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (31 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ standard:                11
--     C++ Compiler:                /usr/bin/c++  (ver 9.3.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed  
--     Linker flags (Debug):        -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco barcode bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 alphamat cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2 sfm ts viz
--     Applications:                apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI:                           GTK3
--     GTK+:                        YES (ver 3.24.20)
--       GThread :                  YES (ver 2.64.6)
--       GtkGlExt:                  NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
--     JPEG 2000:                   build (ver 2.4.0)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      YES (2.2.5)
--     FFMPEG:                      YES
--       avcodec:                   YES (58.54.100)
--       avformat:                  YES (58.29.100)
--       avutil:                    YES (56.31.100)
--       swscale:                   YES (5.5.100)
--       avresample:                NO
--     GStreamer:                   NO
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Intel IPP:                   2020.0.0 Gold [2020.0.0]
--            at:                   /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
--     Intel IPP IW:                sources (2020.0.0)
--               at:                /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
--     VA:                          NO
--     Lapack:                      NO
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.19.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/debugger/opencv_build/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.8.10)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.8.so (ver 3.8.10)
--     numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.17.4)
--     install path:                lib/python3.8/site-packages/cv2/python-3.8
-- 
--   Python (for build):            /usr/bin/python3
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/debugger/opencv_build/opencv/build"><pre class="notranslate">$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
<span class="pl-k">&gt;</span>     -D CMAKE_INSTALL_PREFIX=/usr/local \
<span class="pl-k">&gt;</span>     -D INSTALL_C_EXAMPLES=OFF \
<span class="pl-k">&gt;</span>     -D INSTALL_PYTHON_EXAMPLES=OFF \
<span class="pl-k">&gt;</span>     -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
<span class="pl-k">&gt;</span>     -D OPENCV_GENERATE_PKGCONFIG=ON \
<span class="pl-k">&gt;</span>     -D OPENCV_EXTRA_MODULES_PATH=<span class="pl-k">~</span>/opencv_build/opencv_contrib/modules \
<span class="pl-k">&gt;</span>     -D BUILD_EXAMPLES=OFF ..
-- Detected processor: x86_64
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version <span class="pl-s"><span class="pl-pds">"</span>2.7<span class="pl-pds">"</span></span>)
-- Looking <span class="pl-k">for</span> ccache - not found
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version <span class="pl-s"><span class="pl-pds">"</span>1.2.11<span class="pl-pds">"</span></span>, minimum required is <span class="pl-s"><span class="pl-pds">"</span>1.2.3<span class="pl-pds">"</span></span>) 
Cleaning INTERNAL cached variable: WEBP_LIBRARY
Cleaning INTERNAL cached variable: WEBP_INCLUDE_DIR
-- Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version <span class="pl-k">&gt;</span>= 2.3.1). OpenJPEG will be built from sources
-- OpenJPEG: VERSION = 2.4.0, BUILD = opencv-4.5.5-dev-openjp2-2.4.0
-- OpenJPEG libraries will be built from sources: libopenjp2 (version <span class="pl-s"><span class="pl-pds">"</span>2.4.0<span class="pl-pds">"</span></span>)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version <span class="pl-s"><span class="pl-pds">"</span>1.2.11<span class="pl-pds">"</span></span>) 
-- libva: missing va.h header (VA_INCLUDE_DIR)
-- found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold]
-- at: /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
-- found Intel IPP Integration Wrappers sources: 2020.0.0
-- at: /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR) 
-- A library with LAPACK API found.
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- VTK is not found. Please <span class="pl-c1">set</span> -DVTK_DIR <span class="pl-k">in</span> CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>gtk+-2.0<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>gtk+-2.0<span class="pl-pds">'</span></span> found
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>libavresample<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>libavresample<span class="pl-pds">'</span></span> found
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>gstreamer-base-1.0<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>gstreamer-base-1.0<span class="pl-pds">'</span></span> found
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>gstreamer-app-1.0<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>gstreamer-app-1.0<span class="pl-pds">'</span></span> found
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>gstreamer-riff-1.0<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>gstreamer-riff-1.0<span class="pl-pds">'</span></span> found
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>gstreamer-pbutils-1.0<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>gstreamer-pbutils-1.0<span class="pl-pds">'</span></span> found
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>gstreamer-video-1.0<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>gstreamer-video-1.0<span class="pl-pds">'</span></span> found
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>gstreamer-audio-1.0<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>gstreamer-audio-1.0<span class="pl-pds">'</span></span> found
-- Module opencv_alphamat disabled because the following dependencies are not found: Eigen
-- freetype2:   YES (ver 23.1.17)
-- harfbuzz:    YES (ver 2.6.4)
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>)
-- Julia not found. Not compiling Julia Bindings. 
-- Module opencv_ovis disabled because OGRE3D was not found
-- No preference <span class="pl-k">for</span> use of exported gflags CMake configuration set, and no hints <span class="pl-k">for</span> include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration <span class="pl-k">if</span> available.
-- Failed to find installed gflags CMake configuration, searching <span class="pl-k">for</span> gflags build directories exported with CMake.
-- Failed to find gflags - Failed to find an installed/exported CMake configuration <span class="pl-k">for</span> gflags, will perform search <span class="pl-k">for</span> installed gflags components.
-- Failed to find gflags - Could not find gflags include directory, <span class="pl-c1">set</span> GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
-- Failed to find glog - Could not find glog include directory, <span class="pl-c1">set</span> GLOG_INCLUDE_DIR to directory containing glog/logging.h
-- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
-- Checking <span class="pl-k">for</span> module <span class="pl-s"><span class="pl-pds">'</span>tesseract<span class="pl-pds">'</span></span>
--   No package <span class="pl-s"><span class="pl-pds">'</span>tesseract<span class="pl-pds">'</span></span> found
-- Tesseract:   NO
-- Allocator metrics storage type: <span class="pl-s"><span class="pl-pds">'</span>long long<span class="pl-pds">'</span></span>
-- Registering hook <span class="pl-s"><span class="pl-pds">'</span>INIT_MODULE_SOURCES_opencv_dnn<span class="pl-pds">'</span></span>: /home/debugger/opencv_build/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
-- opencv_dnn: filter out cuda4dnn <span class="pl-c1">source</span> code
-- Excluding from <span class="pl-c1">source</span> files list: <span class="pl-k">&lt;</span>BUILD<span class="pl-k">&gt;</span>/modules/dnn/layers/layers_common.rvv.cpp
-- imgcodecs: OpenEXR codec is disabled <span class="pl-k">in</span> runtime. Details: https://github.com/opencv/opencv/issues/21326
-- highgui: using <span class="pl-c1">builtin</span> backend: GTK3
-- rgbd: Eigen support is disabled. Eigen is Required <span class="pl-k">for</span> Posegraph optimization
-- Found <span class="pl-s"><span class="pl-pds">'</span>misc<span class="pl-pds">'</span></span> Python modules from /home/debugger/opencv_build/opencv/modules/python/package/extra_modules
-- Found <span class="pl-s"><span class="pl-pds">'</span>mat_wrapper;utils<span class="pl-pds">'</span></span> Python modules from /home/debugger/opencv_build/opencv/modules/core/misc/python/package
-- Found <span class="pl-s"><span class="pl-pds">'</span>gapi<span class="pl-pds">'</span></span> Python modules from /home/debugger/opencv_build/opencv/modules/gapi/misc/python/package
-- Found <span class="pl-s"><span class="pl-pds">'</span>misc<span class="pl-pds">'</span></span> Python modules from /home/debugger/opencv_build/opencv/modules/python/package/extra_modules
-- Found <span class="pl-s"><span class="pl-pds">'</span>mat_wrapper;utils<span class="pl-pds">'</span></span> Python modules from /home/debugger/opencv_build/opencv/modules/core/misc/python/package
-- Found <span class="pl-s"><span class="pl-pds">'</span>gapi<span class="pl-pds">'</span></span> Python modules from /home/debugger/opencv_build/opencv/modules/gapi/misc/python/package
-- 
-- General configuration <span class="pl-k">for</span> OpenCV 4.5.5-dev =====================================
--   Version control:               4.5.5-57-g7f6dcc2745
-- 
--   Extra modules:
--     Location (extra):            /home/debugger/opencv_build/opencv_contrib/modules
--     Version control (extra):     4.5.5-5-gbb3048d5
-- 
--   Platform:
--     Timestamp:                   2022-01-18T13:18:57Z
--     Host:                        Linux 5.13.0-25-generic x86_64
--     CMake:                       3.16.3
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               RELEASE
-- 
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (16 files):         + SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (31 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs<span class="pl-k">?</span>:      YES
--     C++ standard:                11
--     C++ Compiler:                /usr/bin/c++  (ver 9.3.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed  
--     Linker flags (Debug):        -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco barcode bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 alphamat cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2 sfm ts viz
--     Applications:                apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI:                           GTK3
--     GTK+:                        YES (ver 3.24.20)
--       GThread <span class="pl-c1">:</span>                  YES (ver 2.64.6)
--       GtkGlExt:                  NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
--     JPEG 2000:                   build (ver 2.4.0)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      YES (2.2.5)
--     FFMPEG:                      YES
--       avcodec:                   YES (58.54.100)
--       avformat:                  YES (58.29.100)
--       avutil:                    YES (56.31.100)
--       swscale:                   YES (5.5.100)
--       avresample:                NO
--     GStreamer:                   NO
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Intel IPP:                   2020.0.0 Gold [2020.0.0]
--            at:                   /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
--     Intel IPP IW:                sources (2020.0.0)
--               at:                /home/debugger/opencv_build/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
--     VA:                          NO
--     Lapack:                      NO
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.19.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/debugger/opencv_build/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.8.10)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.8.so (ver 3.8.10)
--     numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.17.4)
--     install path:                lib/python3.8/site-packages/cv2/python-3.8
-- 
--   Python (for build):            /usr/bin/python3
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring <span class="pl-k">done</span>
-- Generating <span class="pl-k">done</span>
-- Build files have been written to: /home/debugger/opencv_build/opencv/build</pre></div>
<h5 dir="auto">Issue submission checklist</h5>
<ul dir="auto">
<li>[X ] I report the issue, it's not a question

</li>
<li>[X ] I checked the problem with documentation, FAQ, open issues,<br>
forum.opencv.org, Stack Overflow, etc and have not found solution

</li>
<li>[X ] I updated to latest OpenCV version and the issue is still there

</li>
<li>[X ] There is reproducer code and related data files: videos, images, onnx, etc

</li>
</ul>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 4.5.5</li>
<li>Operating System / Platform =&gt; Raspberry Pi OS Bullseye (32-bit)</li>
<li>Compiler =&gt; gcc 10.2.1</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">On Raspberry Pi OS Bullseye (32-bit), OpenCV 4.5.5 Python 3 packages are installed to <code class="notranslate">lib/python3.9/site-packages/cv2/python-3.9</code> instead of <code class="notranslate">lib/python3.9/dist-packages/cv2/python-3.9</code>. Issue happened since OpenCV 4.5.5. OpenCV 4.5.4 Python 3 packages was found successfully because installation directory is <code class="notranslate">lib/python3.9/dist-packages/cv2/python-3.9</code>.</p>
<p dir="auto">I think issue related with <a class="commit-link" href="https://github.com/opencv/opencv/commit/d6891c705e269465222049510ef0920a47507ca9#diff-d55511776794dc61d4962ae7a9025c0fa54a10b3db01de0079c6ad031f259851R180"><tt>d6891c7</tt>#diff-d55511776794dc61d4962ae7a9025c0fa54a10b3db01de0079c6ad031f259851R180</a> (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1074280122" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/21219" data-hovercard-type="pull_request" data-hovercard-url="/opencv/opencv/pull/21219/hovercard" href="https://github.com/opencv/opencv/pull/21219">#21219</a>)</p>
<p dir="auto">Other Debian-based Linux distributions might be affected as well.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto"><code class="notranslate">python3 -c "from sysconfig import *; print(get_path('purelib'))"</code></p>
<p dir="auto">Output: <code class="notranslate">/usr/lib/python3.8/site-packages</code></p>