# How to mitigate a version conflict in CMake

**URL:** <https://forum.opencv.org/t/how-to-mitigate-a-version-conflict-in-cmake/13986>\
**Category:** Python\
**Tags:** cmake, dnn, build\
**Created:** [July 21, 2023, 6:06pm UTC](https://forum.opencv.org/t/how-to-mitigate-a-version-conflict-in-cmake/13986 "2023-07-21T18:06:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Tux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sam_tux/32/8373_2.png) [@Sam\_Tux](https://forum.opencv.org/u/Sam_Tux)\
**Post date:** [July 21, 2023, 6:06pm UTC](https://forum.opencv.org/t/how-to-mitigate-a-version-conflict-in-cmake/13986/1 "2023-07-21T18:06:44Z")

</div>

.When I build OpenCV-dnn with CMake (along this lines: [https://towardsdev.com/installing-opencv-4-with-cuda-in-ubuntu-20-04-fde6d6a0a367](https://towardsdev.com/installing-opencv-4-with-cuda-in-ubuntu-20-04-fde6d6a0a367)) at the stage of cmake command I get

Could NOT find PythonLibs: Found unsuitable version “3.8.14”, but required is exact version “3.8.13”.

After command  
cmake   
-D CMAKE\_BUILD\_TYPE=RELEASE   
-D CMAKE\_INSTALL\_PREFIX=/usr/local   
-D WITH\_CUDA=ON   
-D WITH\_CUDNN=ON   
-D WITH\_CUBLAS=ON   
-D WITH\_TBB=ON   
-D OPENCV\_DNN\_CUDA=ON   
-D OPENCV\_ENABLE\_NONFREE=ON   
-D CUDA\_ARCH\_BIN=6.1   
-D OPENCV\_EXTRA\_MODULES\_PATH=$HOME/acne\_prod/opencv\_contrib/modules   
-D BUILD\_EXAMPLES=OFF   
-D HAVE\_opencv\_python3=ON   
…

How can I change the requirement to “3.8.13-14” to try if it works? I don’t want to break the dev server just to try building the artefact. Or is this hardwired inside of the library?

After creating and activating Python 3.8.13 Anaconda environment I get  
– Found PythonInterp: /home/sam/anaconda3/envs/cvdnn/bin/python3 (found suitable version “3.8.13”, minimum required is “3.2”)  
– Could NOT find PythonLibs: Found unsuitable version “3.8.14”, but required is exact version “3.8.13” (found /usr/lib/x86\_64-linux-gnu/libpython3.8.so)

So PythonInterp finds the required version 3.8.13, but PythonLibs falls back to system version and cmake fails there.
