Python 3 support (Feature #2811)


Added by Anatoliy Kats almost 4 years ago. Updated over 1 year ago.


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

0%

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

Description

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


History

Updated by Christopher Wolfe about 3 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 about 3 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.
Thanks.

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

Updated by Jonathan L about 2 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?

Exists:
/opencv/build/python/2.7

Is Missing:
/opencv/build/python/3.x

(tested on Windows build, OpenCV 3.0.0-alpha)

Thank you

Updated by Maksim Shabunin about 2 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/libpython2.7.so (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/libpython3.4m.so (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/libpython2.7.so (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/libpython3.4m.so (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 1 year ago

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

Updated by Maksim Shabunin over 1 year ago

  • Assignee set to Maksim Shabunin

Updated by Maksim Shabunin over 1 year ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4508

Also available in: Atom PDF