在mavericks中为python安装opencv

时间:2022-09-19 00:19:57

I am trying to install opencv on a Macbook Pro late 2013 with mavericks. I didn't find any binaries so I am trying to build it.
I tried http://www.guidefreitas.com/installing-opencv-2-4-2-on-mac-osx-mountain-lion-with-python-support
and http://forums.udacity.com/questions/100021223/installing-opencv-on-os-x-mountain-lion
when calling make the error 2 is produced
(CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:208)

我正在尝试与mavericks一起在2013年末的Macbook Pro上安装opencv。我没有找到任何二进制文件,所以我正在尝试构建它。我尝试了http://www.guidefreitas.com/installing-opencv-2-4-2-on- macosx - - - - - - - - - - - - - - - - - - - - - - -python- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

When searching on this website I found opencv for python on mavericks (I also tried homebrew which also produced error 2, but without any further information)

当我在这个网站上搜索的时候,我在mavericks上找到了python的opencv(我也尝试了homebrew,它也产生了错误2,但是没有任何进一步的信息)

I googled a lot, but none of the found solutions worked for me. Does anyone have a tut for installing opencv on Mavericks?

我在谷歌上搜索了很多次,但没有一个找到的解决方案对我有效。有没有人想在小牛身上安装opencv ?

Thank you

谢谢你!

using brew gives the following output:

使用brew给出以下输出:

    brew install homebrew/science/opencv
    Warning: It appears you have MacPorts or Fink installed.
    Software installed with other package managers causes known problems for
    Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
    ==> Downloading http://downloads.sourceforge.net/project/opencvlibrary/opencv-un
    Already downloaded: /Library/Caches/Homebrew/opencv-2.4.6.1.tar.gz
    ==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.6.1 -DCMAKE_BUILD_
    ==> make
    cd /tmp/opencv-QBoi/opencv-2.4.6.1/macbuild/modules/stitching && /usr/local/Cellar/cmake/2.8.12/bin/cmake -E cmake_symlink_library ../../lib/libopencv_stitching.2.4.6.dylib ../../lib/libopencv_stitching.2.4.dylib ../../lib/libopencv_stitching.dylib
    /usr/local/Cellar/cmake/2.8.12/bin/cmake -E cmake_progress_report /tmp/opencv-QBoi/opencv-2.4.6.1/macbuild/CMakeFiles  90 91
    [100%] Built target opencv_stitching
    make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
    make: *** [all] Error 2

    READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
    If reporting this please do so at the homebrew/science tap (not mxcl/homebrew).

I solved the problem for me by using canopy (https://www.enthought.com/products/canopy/) which is free for students

我用canopy (https://www.enthought t.com/products/canopy/)为我解决了这个问题

2 个解决方案

#1


5  

You can install it with brew normally.

你可以正常的用brew安装。

brew install homebrew/science/opencv

or

brew tap homebrew/science
brew install opencv

This is how I installed it on my mavericks and it worked fine.

这就是我在我的小牛上安装它的方法,它运行得很好。

#2


1  

$ brew search opencv
        homebrew/science/opencv
$ brew install homebrew/science/opencv

after installed, there is Caveats:

安装后,有以下注意事项:

==> Caveats If you need Python to find the installed site-packages:

==>警告如果您需要Python查找已安装的站点包:

mkdir -p ~/Library/Python/2.7/lib/python/site-packages

mkdir - p ~ /图书馆/ Python / 2.7 / lib / Python /网站

echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

回声的/ usr /地方/ lib / python2.7 /网站的> ~ /图书馆/ Python / 2.7 / lib / Python /网站/ homebrew.pth

so, just do

所以,只做

  mkdir -p ~/Library/Python/2.7/lib/python/site-packages
  echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

#1


5  

You can install it with brew normally.

你可以正常的用brew安装。

brew install homebrew/science/opencv

or

brew tap homebrew/science
brew install opencv

This is how I installed it on my mavericks and it worked fine.

这就是我在我的小牛上安装它的方法,它运行得很好。

#2


1  

$ brew search opencv
        homebrew/science/opencv
$ brew install homebrew/science/opencv

after installed, there is Caveats:

安装后,有以下注意事项:

==> Caveats If you need Python to find the installed site-packages:

==>警告如果您需要Python查找已安装的站点包:

mkdir -p ~/Library/Python/2.7/lib/python/site-packages

mkdir - p ~ /图书馆/ Python / 2.7 / lib / Python /网站

echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

回声的/ usr /地方/ lib / python2.7 /网站的> ~ /图书馆/ Python / 2.7 / lib / Python /网站/ homebrew.pth

so, just do

所以,只做

  mkdir -p ~/Library/Python/2.7/lib/python/site-packages
  echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth