opencv – Cannot import cv2 in python in OSX
opencv – Cannot import cv2 in python in OSX
You can install by
pip install opencv-python
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 doesnt neccesarilly get you the last version nor a fully optimized one:
opencv – Cannot import cv2 in python in OSX
I used
conda install opencv
and it installed fine for me.
You might want to try this if you are using Anaconda.