小编典典

如何为Python安装OpenCV

python

嗨!我正在尝试安装opencv并将其与python一起使用,但是当我对其进行编译时,没有出现任何错误,但无法从python导入cv模块:

patrick:release patrick$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named cv

我用来编译的代码是这样的:

cd opencv
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON
make
sudo make install

我怎样才能在python中使用它呢?


阅读 213

收藏
2021-01-20

共1个答案

小编典典

我在这里找到了一种安装适用于python的opencv的方法:http : //recursive-
design.com/blog/2010/12/14/face-detection-with-osx-and-python/ :)

2021-01-20