0% found this document useful (0 votes)
92 views

Installing Python and Opencv

The document provides instructions for installing Python 2.7.13 and additional libraries like NumPy, Matplotlib and OpenCV on Windows. It details downloading and installing Python, adding it to the system PATH, downloading library files, and using pip to install the libraries. Basic testing of the installed components is also demonstrated.

Uploaded by

Fatima Tariq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

Installing Python and Opencv

The document provides instructions for installing Python 2.7.13 and additional libraries like NumPy, Matplotlib and OpenCV on Windows. It details downloading and installing Python, adding it to the system PATH, downloading library files, and using pip to install the libraries. Basic testing of the installed components is also demonstrated.

Uploaded by

Fatima Tariq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Step1. Download and install Python 2.7.

13

https://www.python.org/downloads/release/python-2713/
Even though your PC might be 64-bit, but I would still recommend you to use x86 version (last option) and thats a .msi file (runs like exe file,
so no need to open it using winrar). If youre using x64 file, you might have problem following this tutorial.

Click it, and save it.


Since Ive already installed it, thats why you see this window. Yours will ask you about the directory where you want to install it. Dont change
it in order to save time and effort. It should be C:\Python27 by default if youre changing it, do note it somewhere
Step2. Adding path directory for Python 2.7.13

Go to This PC. Right click on empty space go to properties.


This window should pop up.

Go to advanced system settings


Then environment variables
For windows 7/8/8.1

Scroll down till you see Path


Click Edit and then paste the destination folder of python27 here after putting a semicolon ;

I wrote ;C:\Python27 after this click OK. And now youve installed python. I order to check if youve installed it correctly,
go to command prompt (press window+R on keyboard type cmd and press enter)
On command prompt type python. Something like this should appear
For windows 10

3
1

Edit Path Add C:\Python27 and click OK. Go to cmd and type python to verify your install.
Step3. Download add-ons to Python2.7.13
Add-on that well be needing is numpy, matplotlib and opencv
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Scroll down and look for these packages.

(This is a compiled imaged, you wont see all three of them in this order)

If youve installed 64bit version of Python2.7.13, then look for the suitable package, it would have x64amd written in the end.
32bit version for python2.7

64bit version for python2.7

Click on them to start download.


Step4. Install add-on for Python2.7.13

Identify the folder where these add-ons were downloaded. Default folder is Downloads. You might wanna transfer you files here
in order to keep it simple
Go to command Prompt, and change directory to Downloads folder by typing cd Downloads
Then type C:\Python27\Scripts\pip install opencv_python-3.1.0-cp27-cp27m-win32.whl
(you might wanna copy/paste the name of the file rather than typing it--- unless youve download x64 version :p )

Press Enter and let it roll (start of the process might take time, so dont panic thinking k computer atak gaya hai)
And voila Now install other 2 using the same method: (type in the following commands)
C:\Python27\Scripts\pip install numpy-1.13.0+mkl-cp27-cp27m-win32.whl
C:\Python27\Scripts\pip install matplotlib-2.0.2-cp27-cp27m-win32.whl
All done.
Step5. Testing Python 2.7.13 with add-ons

Go to command prompt and type python


Now write the following lines, there shouldnt be any error messages and it should like something like this. Enter this line-by-line

import cv2
import numpy
import matplotlib

Well python comes with its own IDE: Python IDLE (type it in start->search) well be using that for writing codes instead of cmd
Step6. Start learning Python and OpenCV
Im following this tutorial series for OpenCV, you guys might wanna checkout his tutorials as well

https://www.youtube.com/watch?v=Z78zbnLlPUA&list=PLQVvvaa0QuDdttJXlLtAJxJetJcqmqlsssQq&index=1

You might also like