Python 3 support (Feature #2811)

Added by Anatoliy Kats over 4 years ago. Updated about 2 years ago.

Status:Open Start date:2013-02-18
Priority:Normal Due date:
Assignee:Maksim Shabunin % Done:


Category:python bindings
Target version:3.0
Difficulty: Pull request:


Ubuntu is no longer shipping Python 2.x by default a year from now. Can we add Python 3 support to OpenCV?


Updated by Christopher Wolfe almost 4 years ago

May I contribute to this feature? I prefer to use Python 3, so I would benefit from Python 3 support.

Updated by Dmitry Retinskiy almost 4 years ago

Hello Christopher and Anatoliy,

Python 3 support has been already added to OpenCV master (it will be released as OpenCV 3.0).
If you are interested in using it in OpenCV 2.4 you may help with porting existing solution backward.
In this case please use usual pull request procedure.

  • Target version set to 3.0
  • Assignee deleted (Vadim Pisarevsky)

Updated by Jonathan L almost 3 years ago

I noticed the early version of OpenCV 3.0 is available.

But the python 3 support appears to be unbuilt or not ready. Can someone confirm this?


Is Missing:

(tested on Windows build, OpenCV 3.0.0-alpha)

Thank you

Updated by Maksim Shabunin almost 3 years ago

Hi, I've built python3 wrapper library for OpenCV 3, but I'm using Ubuntu.
cmake output:

-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/ (found suitable exact version "2.7.6") 
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4", minimum required is "3.4") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/ (found suitable exact version "3.4.0") 
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.6)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/ (ver 2.7.6)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.1)
--     packages path:               lib/python2.7/dist-packages
--   Python 3:
--     Interpreter:                 /usr/bin/python3.4 (ver 3.4)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/ (ver 3.4.0)
--     numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.8.1)
--     packages path:               lib/python3.4/dist-packages
--   Python (for build):            /usr/bin/python2.7

Resulting library is put to "<builddir>/lib/python3".

Updated by Robert Pollak over 2 years ago

opencv-3.0.0-beta.exe still only contains build\python\2.7\ :-/

Updated by Maksim Shabunin over 2 years ago

  • Assignee set to Maksim Shabunin

Updated by Maksim Shabunin about 2 years ago

Issue has been transferred to GitHub:

Also available in: Atom PDF