- Tested on: Windows 7, Windows 10
- There could be other ways to get Open CV working on your Windows computer
- Find you OS architecture
- Decide the Python version (e.g. 2.7 or 3.x)
- Install Anaconda, open terminal as administrator and , launch “python” and type “import numpy as np”, to test your installation
- Decide the version of Open CV you want to install, from the list of available versions
- Upgrade pip (use pip3 if using Python 3.x)
Find your OS architecture by issuing following command:
systeminfo | findstr /I type:
Install or Upgrade pip (or pip3 for Python 3.x):
python get-pip.py python -m pip install --upgrade pip
You can install Open CV using pip or manually. Installing Anaconda should already have taken care of dependencies for Open CV.
To find the list of available versions of Open CV through pip (or pip3) I use following:
pip install opencv_python==
Which prints an informative error message as following
Could not find a version that satisfies the requirement opencv_python== (from versions: 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199)
No matching distribution found for opencv_python==
If your version is in the list …
pip install 'opencv_python==x.x.x.x...'
… and done! Skip ahead to verification.
else If you want to install using (Ana)conda …
In Anaconda command prompt
conda install -c menpo opencv
- conda install –channel https://conda.anaconda.org/menpo opencv3
- conda install -c https://conda.binstar.org/menpo opencv
But if you need to install a version(e.g. 2.4.9) that is not available through pip, you need to download that version, extract the files.
- Let’s say you extracted your files to C:\opencv folder, on a 64 bit operating Windows OS and you are using Python 2.7. Navigate to C:\opencv\build\python\2.7\x86
- Copy cv2.pyd file
- Navigate to Anaconda Python installation path, in my case C:\Users\WildClick\AppData\Local\Continuum\Anaconda2\Lib\site-packages
Start Python in Anaconda terminal, type
import cv2 cv2.__version__