Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
706 views
in Technique[技术] by (71.8m points)

python 3.x - Installing opencv for python3

Has anyone tried to install opencv for python3?. As stated here http://opencv.willowgarage.com/wiki/InstallGuide its support status is unknown. So I want to try it:

I have downloaded the sources for OpenCV-2.3.1. But cmake reports.

-- Python interpreter: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3 -B (ver 3.2)

-- Python numpy: NO (Python wrappers will not be generated)

I do have numpy (version 1.6.0) installed in python3 but cmake does not find it. I am using Mac OSX 10.6 Any ideas?

Update

I just saw one more thing of the cmake output that might be helpful

-- Found PythonInterp: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3 (found version "3.2")

-- Found PythonLibs: /usr/lib/libpython2.6.dylib File "", line 1

from distutils.sysconfig import *; print get_python_lib()

                                                      ^

SyntaxError: invalid syntax File "", line 1

import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print

numpy.distutils.misc_util.get_numpy_include_dirs()[0]

                                                                    ^ 

SyntaxError: invalid syntax File "", line 1

import sphinx; print sphinx.__version__

                          ^ SyntaxError: invalid syntax

Notice that it found 3.2 but then libpython2.6 ??

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

At the moment OpenCV supports Python 2.x only. OpenCV (including OpenCV 2.4) does not compiles with Python 3.x.

Python3 support is already in wishlist for future versions of OpenCV. But currently there are no activities in this direction and you are welcome to create and contribute a patch resolving the compatibility issues.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...