I was using “pip install opencv-contrib-python” to install the packages which contain both main modules and contrib/extra modules. However, the installed version is 4.5.1. How could I install 4.5.1-dev? Thanks!
Hi,
That’s not possible with pip.
If you need a dev version you have to buiild is using cmake
you don’t need a “dev” version.
OpenCV has releases. those are good for everything.
“dev version” means git master HEAD, and you don’t need that unless you actually work on OpenCV itself.
You can do that by compiling the development version manually. This can be done by following the manual build instructions at opencv-python documentation: GitHub - opencv/opencv-python: Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.
Short summary:
Make sure you have build tools installed and you have the latest version of pip
.
- Clone the repository:
git clone --recursive https://github.com/opencv/opencv-python.git
cd opencv-python
-
cd opencv
→git pull
→ checkout the latest development commit →cd ..
-
cd opencv_contrib
→git pull
→ checkout the latest development commit →cd ..
export ENABLE_CONTRIB=1
- Run
pip wheel . --verbose
(this will take over 5 minutes, usually 10+) - Wheel package will be generated to dist-directory
- Install the custom package from the dist-directory with
pip install package_name.whl
1 Like