There are certain libraries such as fswebcam, cv2 etc. But pip cant find a matching distribution for Python3 on Win7 64bit. Are there any other libraries or how can i use these two to capture images from Python
-
`pip install python-opencv` does this work? – Santosh Kumar Aug 12 '18 at 09:23
-
No matching distribution – kramer Aug 12 '18 at 09:38
-
`pip install opencv-python` .. later use `import cv2` in the script – Surya Tej Aug 12 '18 at 09:59
-
possible duplicate of https://stackoverflow.com/questions/34588464/python-how-to-capture-image-from-webcam-on-click-using-opencv – Surya Tej Aug 12 '18 at 10:01
-
Try [VideoCapture](https://www.lfd.uci.edu/~gohlke/pythonlibs/#videocapture). – cgohlke Aug 12 '18 at 17:34
2 Answers
I installed openCV on my 64-bit windows 10 machine using openCV and numpy wheels, which I installed using pip.
You can find the numpy wheels here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
And the cv2 wheels here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
Make sure you find the wheels specific to your setup, ie. 64-bit with python 3.6, use: numpy‑1.14.5+mkl‑cp36‑cp36m‑win_amd64.whl
Save those in a folder, then navigate to that folder in a command window and install the files using pip.
The full guide is here if needed: https://solarianprogrammer.com/2016/09/17/install-opencv-3-with-python-3-on-windows/

- 765
- 6
- 14
I guess the reason is that you have both Python2 and Python3 installed, and therefore pip only works for Python 2. You can install OpenCV as follows:
python3 -m pip install opencv-python
You have to make sure Python 3 has been added to the system path and the command Python3
is available. If the executable file of Python 3 is named Python, just rename it to Python3.

- 11,695
- 8
- 37
- 64