pip install opencv2 with specific version

Last Updated On Wednesday 27th Oct 2021

OpenCV Python

Via pip you can specify the package version to install using the following

	pip install opencv-python==2.4.9
	

If Get following error,May be try the Anaconda

	No matching distribution found for opencv==2.4.9
	

To Checking available versions

	pip install opencv-python==
	

Another easy way, you can type in terminal.

	sudo apt-get install python-opencv
	

opencv2 python

After installing it, you can use opencv version 2.4 in both c++ and python.

But I recommend you should use opencv 3.2.0 and opencv-contrib, it gives more features

You can also do it using Anaconda

	conda install -c https://conda.binstar.org/menpo opencv=2.4.9
	

Install OpenCv2

If you’re a Windows user, opencv can be installed using pip, like this:

	pip install opencv-python==<python version>

ex - pip install opencv-python==3.6
	

If you’re a Linux user:

	sudo apt-get install python-opencv