为python3安装opencv [英] Installing opencv for python3

查看:666
本文介绍了为python3安装opencv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人试图为python3安装opencv吗?如此处 http://opencv.willowgarage.com/wiki/InstallGuide 中所述,其支持状态未知。所以我想尝试一下:

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:

我已经下载了OpenCV-2.3.1的源代码。但是cmake报告。

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


- Python解释器:/Library/Frameworks/Python.framework/Versions/3.2/bin/python3 -B ver
3.2)

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

- Python numpy:NO(不生成Python封装容器)

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

我有在numthon(版本1.6.0)安装在python3,但cmake没有找到它。我使用Mac OSX 10.6任何想法?

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?

更新


- 找到PythonInterp:/Library/Frameworks/Python.framework/Versions/3.2 / bin / python3(找到
版本3.2)

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

- 找到PythonLibs:/usr/lib/libpython2.6.dylib文件 1

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

from distutils.sysconfig import *; print get_python_lib()

                                                      ^

语法错误:第1行

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

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

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

                                                                    ^ 

语法错误:无效语法文件,第1行

SyntaxError: invalid syntax File "", line 1

import sphinx; print sphinx.__version__

                          ^ SyntaxError: invalid syntax



$ b b

注意,它发现了3.2,但后来发现了libpython2.6 ??

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

有什么想法吗?

推荐答案

目前OpenCV仅支持Python 2.x。 OpenCV(包括OpenCV 2.4)不使用Python 3.x编译。

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

Python3支持已经在愿望清单中为未来的OpenCV版本。但目前没有这方面的活动,欢迎您创建和贡献补丁来解决兼容性问题。

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.

这篇关于为python3安装opencv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆