码迷,mamicode.com
首页 > 编程语言 > 详细

Install OpenCV in Windows for Python

时间:2016-12-08 20:40:49      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:exe   using   msi   cli   for   one   .net   python2.7   bit   

Here I will tell you how to 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 that case, Python will be installed in default folder C:\Python27\


2) Now install Numpy. Again leave everything default. Numpy will find Python directory and will be installed to most appropriate folder.

3) Now double-click OpenCV.exe. It will ask for extraction folder. Give it as just C:\. It will 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 will be 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 will import cv2 module, otherwise an error message will be shown.

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

NB : Even if you are using 64-bit windows, do the same procedure. ( Better don‘t go for 64-bit Python and Numpy )

Install OpenCV in Windows for Python

标签:exe   using   msi   cli   for   one   .net   python2.7   bit   

原文地址:http://www.cnblogs.com/dreamafar/p/6146011.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!