Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: How to pip install opencv2 with specific version 2.4.9?

I know that I could pip install opencv-python which installs opencv3, but is there a separate command or name for opencv specific version such as 2.4.9?

If not, how can I specify which version to install?

Thanks.

like image 979
matchifang Avatar asked Jun 08 '17 15:06

matchifang


People also ask

How do I import opencv2 into Python?

Start the Python shell by typing python3 and then hit enter. You will be inside the Python shell where you can execute your Python code. Import the cv2 package which is the name of the OpenCV module. Type “import cv2” and hit enter.

Can you pip install OpenCV?

OpenCV can be installed using pip. The following command is run in the command prompt to install OpenCV. This command will start downloading and installing packages related to the OpenCV library. Once done, the message of successful installation will be displayed.


1 Answers

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

pip install opencv-python==2.4.9 

However, that package does not seem to be available on pypi.

A little trick for checking available versions:

pip install opencv-python==

Which returns:

Could not find a version that satisfies the requirement opencv-python== (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1 .0.3, 3.1.0.5, 3.2.0.6, 3.2.0.7) No matching distribution found for opencv-python==

like image 178
etemple1 Avatar answered Sep 20 '22 17:09

etemple1