I have built the latest OpenCV4.5.5 from github repository on Windows using CMake and Visual Studio 2019. Then I have tried to deploy/install the OpenCV module for Python. I have anaconda working on the system and I can run opencv in an environment if I install the binaries through pip. But I want to build from source in order to use Cuda version of DNN which is not possible with the pre-built libraries.
I have created a new environment before building the OpenCV and have used the environment’s lib/site-packages path in the CMake as a python3 packages path. Then I have built the INSTALL project in the visual studio and have gotten an installed libraries folder with lib, bin and includes. However, I still do not have anything in anaconda environment and ’ import cv2 ’ doesn’t work in the newly created environment.
Why don’t visual studio generate python library as well?
In addition to the above I have also tried to create a pip wheel from source of opencv-python repo from github (https://github.com/opencv/opencv-python). The wheel was created successfully and it works in contrast to the visual studio compilation.