简单粗暴
使用homebrew安装
brew install opencv //cv2 我安装的brew install opencv3 //cv3安装包位置
/Library/Caches/Homebrew解压的文件位置
/usr/local/Cellar/opencv找到cv2.so拷贝到python的site-packages里面
cv2.so按照上面的安装默认位置在/usr/local/Cellar/opencv/3.3.0_3/lib/python2.7/site-packages/cv2.sopythonde site-packages位置执行下面的python命令查看
import siteprint(site.getsitepackages())我的位置是/Library/Python/2.7/site-packages
sudo cp /usr/local/Cellar/opencv/3.3.0_3/lib/python2.7/site-packages/cv2.so /Library/Python/2.7/site-packages
检查
import cv2cv2.__version__