June 5th, 2017
Python2 (opencv2) with Homebrew
Python 2
brew install pythonbrew install opencvpython
>>> import cv2
Python3 (opencv3) with Homebrew and PIP
Python3
brew install python3brew uninstall opencv3brew install opencv3 --without-python --with-python3echo /usr/local/opt/opencv3/lib/python3.6/site-packages >> /usr/local/lib/python3.6/site-packages/opencv3.pthpython3
>>> import cv2
Refer to this
Install dlib (only for Python3)
dlib is very useful for face detection machine learning, but it is hard to install on mac osx with python. compile issue and compile issue2
I got some script from this, but still not working for me.
Using PIP3 to install dlib for python3
- Install boost for python3 but not for python2
brew install boost-python --with-python3 --without-python
pip3 install dlibpython3
>>> import dlib