Skip to content

Instantly share code, notes, and snippets.

@vdt
Forked from ldong/install_opencv_on_mac.md
Created November 23, 2016 16:54
Show Gist options
  • Select an option

  • Save vdt/0b1fa2d5b743fcf7070dc94c68bdc9b0 to your computer and use it in GitHub Desktop.

Select an option

Save vdt/0b1fa2d5b743fcf7070dc94c68bdc9b0 to your computer and use it in GitHub Desktop.
install opencv on mac
  1. Create a virtualenv, mkvirtualenv lookup

  2. install opencv on mac via homebrew

brew tap homebrew/science
brew install opencv
cd ~/.virtualenvs/lookup/lib/python2.7/site-packages
ln -s /usr/local/Cellar/opencv/{VERSION_NUMBER}/lib/python2.7/site-packages/cv.py cv.py
ln -s /usr/local/Cellar/opencv/{VERSION_NUMBER}/lib/python2.7/site-packages/cv2.so cv2.so

i.e.

cd ~/.virtualenvs/lookup/lib/python2.7/site-packages
ln -s /usr/local/Cellar/opencv/2.4.12_2/lib/python2.7/site-packages/cv.py cv.py
ln -s /usr/local/Cellar/opencv/2.4.12_2/lib/python2.7/site-packages/cv2.so cv2.so
  1. Test see it works or not.
workon lookup
python
import cv2

Reference

https://gist.github.com/stilist/cd7fdfabbf9ec5ed89b7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment