Install python 3.6 with opencv 3.3.0 in windows 10

I want to using new method for mouse tracking. but it looks like not support python2.7.
so I need to get a environment of python 3.6 and opencv 3.3.0
It is much much easier! because it already have pip and have a option to automatic add Path.


  1. install python 3.6
    • if you had install older version of python. please uninstall them before install new version.
    1. download python 3.6.3 from https://www.python.org/downloads/
    2. run the "python-3.6.3.exe", remember to select "Add Python 3.6 to PATH" and install
    3. go to cmd, type "pip", make sure pip is installed.
  2. install opencv 3.3.0
    1. download the correct .whl file from https://pypi.python.org/pypi/opencv-python
    2. run cmd
    3. type "pip install packagename.whl" (packagename is the name of your .whl file)
    4. after it complete. goto IDLE and use following code the makesure it works.
import cv2

print (cv2.__version__)

cap = cv2.VideoCapture(0) #0 is 1st camera, 1 is 2nd


while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    # Display the resulting frame
    cv2.imshow('frame',gray )

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

Comments

Popular posts from this blog

some errors with tensorflow 'object_detection' and preprocessor_pb2

Insatll python 2.7.14 with opencv 3.3.0