These steps are tested on windows 7.
Please download following Python packages and install them to their default locations Python 2.7. Also make the environment variable as name
Path
with value set toC:\Python27;%PYTHON_HOME%\;%PYTHON_HOME%\Scripts\;
Please find pip installer python file named
get-pip.py
from here get-pip.py.Press shift button and right click anywhere in the folder and select “Open command window here” and enter:
python get-pip.py
.The pip installer will be installed and the go to
C:\Python27\Scripts
and again while holding the shift button in the Scripts folder right click to open the command window here. Enter the commandpip install dateutils
.Stay in the same command prompt and also install
matplotlib
by using the commandpip install matplotlib
.In addition we also need imutils , so again enter the command
pip install imutils
.Perform the command
pip install pytesseract==0.1.8
.The Tesseract-OCR setup is also required. Go ahead and install using the defaults values.
An additional command has to be added in the python
.py
file, such as:pytesseract.pytesseract.tesseract_cmd = 'C:/Program Files (x86)/Tesseract-OCR/tesseract'
.Now, we need to install opencv.
Extract the opencv to C: drive and after the extraction finishes , Go to the location
C:\opencv\build\python\2.7\x86
.And copy the file
cv2.pyd
from the locationC:\opencv34\opencv\build\python\2.7\x86
and paste it to the locationC:/Python27/Lib/site-packages
.Now check the installation by
python
import cv2
print(cv2.__version__)
The output will be 2.4.9. Congratulations! you have now successfully setup opencv and python.