Top Ad unit 728 × 90

Install OpenCV 3 and Dlib on Windows ( Python only )

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.

Step 1: Install Anaconda (a python distribution)

Download and install Anaconda 64-bit version from
It is advised to install Anaconda for Python 3.

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

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 : Download and Install OpenCV

3.1. Download the pre-built binary

Open this link in a new tab. You should get a window as shown below :
Download the file named “opencv_python-3.3.1+contrib-cp36-cp36m-win_amd64.whl”. Note that it is for OpenCV 3.3.1 + contrib modules for python version 3.6 and windows with x64 architecture. If you have a 32-bit architecture, then download “opencv_python-3.3.1+contrib-cp36-cp36m-win32.whl”.
Keep in mind that this file may change when new versions of OpenCV come out.

3.2. Activate the environment

Change to the Download directory and execute the following commands.
cd C:\Users\YOUR_USERNAME\Downloads
# See how the (opencv-env) appears before the prompt after this command.
activate opencv-env

3.3. 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_python-3.3.1+contrib-cp36-cp36m-win_amd64.whl
pip install dlib

3.4. Test your installation

Open the python prompt on the command line by typing python on the command prompt
import cv2
import dlib
You should get the following output
Install OpenCV 3 and Dlib on Windows ( Python only ) Reviewed by Jacky on tháng 10 07, 2018 Rating: 5

Không có nhận xét nào:

All Rights Reserved by Cộng Đồng OpenCV © 2017
Edit bởi: Jacky Le | Youtube Channel: JACKY LE

Biểu mẫu liên hệ


Email *

Thông báo *

Được tạo bởi Blogger.