Cannot import cv2 in python in OSX

I do not know what pip install cv2 actually installs… but is surely not OpenCV. pip install cv2 actually installs this, which are some blog distribution utilities, not sure what it is, but it is not OpenCV.


To properly install OpenCV, check any of the links @udit043 added in the comment, or refer to any of the tutorials bellow:

Find here a tutorial on how to install OpenCV on OS X: http://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/

You need to actually compile OpenCV from source and activate python bindings, which takes a while.

Another option is to use brew to get OpenCV, but doesn’t neccesarilly get you the last version nor a fully optimized one:

https://web.archive.org/web/20171218032016/http://www.mobileway.net/2015/02/14/install-opencv-for-python-on-mac-os-x/

Leave a Comment

tech