Skip to content

Instantly share code, notes, and snippets.

@jtryan
Last active April 26, 2018 17:52
Show Gist options
  • Save jtryan/08223927f06811edf130b75bb7ce10a2 to your computer and use it in GitHub Desktop.
Save jtryan/08223927f06811edf130b75bb7ce10a2 to your computer and use it in GitHub Desktop.
opencv3 on os x - April 2018

Brew has changed the opncv3 cask.

It is now part of core and has lost the ability to use cli argument on install

  1. Install brew
  2. brew install python
  3. brew install python3
  4. brew install opencv
  5. pip install virtualenv virtualenvwrapper

Now do some cleanup.

Python 2.7

echo /usr/local/opt/opencv@3/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth

mkvirtualenv cv -p python

pip install numpy

ln -s /usr/local/opt/opencv@3/lib/python2.7/site-packages/cv2.so cv2.so

Python 3.6

echo /usr/local/opt/opencv@3/lib/python3.6/site-packages >> /usr/local/lib/python3.6/site-packages/opencv3.pth

mkvirtualenv cv -p python3

pip install numpy

ln -s /usr/local/opt/opencv@3/lib/python3.6/site-packages/cv2.cpython-36m-darwin.so cv2.so

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