Install OpenCV in Windows for Python

Source: Internet
Author: User

Here I'll tell what you do to the install OpenCV 2.4x in Windows for Python 2.7.

pre-requisites (need to be downloaded):

Python:download latest version of Python 2.7 from Python site.
Numpy:download Numpy for Python 2.7 from here.
OpenCV 2.4:download OpenCV for Windows from here.

Install:


1) first install Python 2.7. Leave all settings as default. In this case, Python would be installed in default folder C:\Python27\


2) now install Numpy. Again leave everything default. Numpy would find Python directory and would be installed to the most appropriate folder.

3) now double-click OpenCV.exe. It'll ask for extraction folder. Give it as just C: \. It'll extract all files to C:\opencv\. Wait until everything is extracted.


4) Now copy everything in the folder C:\opencv\build\python\x86\2.7\ (most probably, there'll be is only one file Cv2.pyd ) and paste it in the folder C:\Python27\Lib\site-packages\


5) Now open your ' Python idle ' (from Start > All programmes > Python 2.7 > Python idle) and just type following :
Import Cv2


If everything OK, it would import CV2 module, otherwise an error message would be shown.

So it's very simple procedure. Try it yourself and let me know how it goes.

Nb:even If you is using 64-bit windows, do the same procedure. (Better don ' t go for 64-bit Python and Numpy)

Install OpenCV in Windows for Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.