OpenCV 3 works with Python 2.7, 3.4, 3.5 and 3.6. Choose ONE of the following methods:
This method uses the unofficial OpenCV PyPi wheels for Linux, Mac and Windows.
python -m pip install opencv-python
If you want OpenCV including the Extra contributed modules, instead do:
python -m pip install opencv-contrib-python
This works for Linux, Mac and Windows.
conda install -c conda-forge opencv
You can compile and install OpenCV for Python 2.7 to Python 3.6. Or compile OpenCV with extra contributed packages. Compiling yourself allows customizing and optimizing OpenCV for your computer (e.g. using GPU, TBB, OpenCL, etc.).
- OpenCV 3 release notes
- Conda-forge OpenCV 3
- (reference) Windows-only OpenCV wheels. (cpMN where you have Python M.N).
contribincludes OpenCV-extra packages. For example, assuming you have Python 3.6, you might download
Python executable selection
If you get the
... is not supported on this platform error be sure you’re not accidentally using Python 2.7 instead of Python 3, you may have to manually specify the path for the
pip command e.g.
c:\anaconda3\scripts\python -m pip install opencv-python
Test Python OpenCV install
Test scripts to try out the OpenCV install.