• Home
  • >
  • Install
  • >
  • Install OpenCV 3 and Dlib on Windows ( Python only )

Install OpenCV 3 and Dlib on Windows ( Python only )

This is an old blog and some information might be obsolete. We have published new instructions. You can find them here: Setup exe installers for Windows Install OpenCV from source on Windows We already have a post for installing OpenCV 3 on Windows which covers how to install OpenCV3 from

This is an old blog and some information might be obsolete. We have published new instructions. You can find them here:

  1. Setup exe installers for Windows
  2. Install OpenCV from source on Windows

We already have a post for installing OpenCV 3 on Windows which covers how to install OpenCV3 from source for working with both C++ and Python codes. However, many readers have faced problems while installing OpenCV 3 on Windows from source. This post is for those readers who want to install OpenCV on Windows for writing Python code only.

If you are still not able to install OpenCV on your system, but want to get started with it, we suggest using our docker images with pre-installed OpenCV, Dlib, miniconda and jupyter notebooks along with other dependencies as described in this post.

Step 1: Install Anaconda (a python distribution)

Download and install Anaconda 64-bit version from https://www.continuum.io/downloads.

It is advised to install Anaconda for Python 3.

Download and Install 64-bit Anaconda 2 or Anaconda 3 or both

While installing Anaconda make sure that you check both options:

  1. Add Anaconda to my PATH environment variable
  2. Register Anaconda as my default Python
Add Anaconda to System PATH and make it default Python

Step 2 : Create Virtual Environment

Open the command prompt and execute the following command.

conda create --name opencv-env python=3.6

You should get an output as shown below:

Press Enter and the environment will be installed and you should get an output as shown below :

Step 3 : Install OpenCV

3.1. Activate the environment

# See how the (opencv-env) appears before the prompt after this command.
activate opencv-env

3.2. Install OpenCV and other important packages

Continuing from the above prompt, execute the following commands

pip install numpy scipy matplotlib scikit-learn jupyter
pip install opencv-contrib-python
pip install dlib

3.3. Test your installation

Open the python prompt on the command line by typing python on the command prompt

import cv2
cv2.__version__
import dlib
dlib.__version__

You should get the following output

Read Next

VideoRAG: Redefining Long-Context Video Comprehension

VideoRAG: Redefining Long-Context Video Comprehension

Discover VideoRAG, a framework that fuses graph-based reasoning and multi-modal retrieval to enhance LLMs' ability to understand multi-hour videos efficiently.

AI Agent in Action: Automating Desktop Tasks with VLMs

AI Agent in Action: Automating Desktop Tasks with VLMs

Learn how to build AI agent from scratch using Moondream3 and Gemini. It is a generic task based agent free from…

The Ultimate Guide To VLM Evaluation Metrics, Datasets, And Benchmarks

The Ultimate Guide To VLM Evaluation Metrics, Datasets, And Benchmarks

Get a comprehensive overview of VLM Evaluation Metrics, Benchmarks and various datasets for tasks like VQA, OCR and Image Captioning.

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.

Subscribe to receive the download link, receive updates, and be notified of bug fixes

Which email should I send you the download link?

 

Get Started with OpenCV

Subscribe To Receive

We hate SPAM and promise to keep your email address safe.​