Search code examples
pythonopencvpython-venv

How to install opencv that was built with CMAKE build option to venv?


How to install opencv that was built with CMAKE build option to venv ?

Usually when I want to use opencv in venv, I was usually execute pip install opencv-python. However if so, the opencv is the one built by default option.

Is there are ideas to install opencv that was built with CMAKE build option ?

What I tried :

  • I googled how to pip install opencv-python by specify CMAKE build option, but there are no information about this.

  • Check opencv-python reference , but no information.
    https://github.com/opencv/opencv-python


Solution

  • PyPI Official site tells us how to create manual-built whl of python-opencv .

    https://pypi.org/project/opencv-python/

    Manual builds

    If some dependency is not enabled in the pre- built wheels, you can also run the build locally to create a custom wheel.