Install OpenCV3.2 on MacOS X and opencv3.2 on macos

Source: Internet
Author: User
Tags symlink

Install OpenCV3.2 on MacOS X and opencv3.2 on macos

Windows platform and linux Platform Installation See Official documentation:

The installation on mac is not found on the official platform. Refer:

Https:// Core Command on two sentences, super simple.
brew tap homebrew/sciencebrew install opencv3

However, we also encountered a bunch of problems. The record process is as follows:

brew install opencv3


Error: You must `brew link openexr` before homebrew/science/opencv3 can be installed

2. I thought that openexr is not installed, check the think it is OK to not install, just have -- without-openexr this option, so:

brew install opencv3 --without-openexr


Error: The `brew link` step did not complete successfullyThe formula built, but is not symlinked into /usr/localCould not symlink share/aclocal/cmake.m4/usr/local/share/aclocal is not writable.You can try again using:  brew link cmake………………

3. Follow the prompts:

brew link pkg-config


Error: Could not symlink share/aclocal/pkg.m4/usr/local/share/aclocal is not writable.

4. Oh, no permission. So:

sudo brew link pkg-config


Error: Running Homebrew as root is extremely dangerous and no longer supported.

5. It was not allowed, so I had to change the folder permission.

Whoami # 'whoamam' in the following two commands replaces sudo chown-R 'whoam' with the output of the command: admin/usr/local/share sudo chown-R 'whoam ': admin/usr/local/bin
brew link pkg-configbrew link cmakebrew install opencv3 --without-openexr

Success: it is estimated that the first error reported in the first step is that you do not have the permission to establish software access.

6. Link to the python environment. Here is the link to the tensorflow1.0 environment created by anaconda.

cd /Users/yuetiezhu/anaconda2/envs/tensorflow1.0/lib/python2.7/site-packagesln -s /usr/local/Cellar/opencv3/3.2.0/lib/python2.7/site-packages/

/Usr/local/Cellar/opencv3/3.2.0/lib/python2.7/site-packages no cv. py only, but it can be used.

7. Test it.

source activate tensorflow1.0pythonimport cv2


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.