mac安装OpenCV

简单粗暴使用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.so
pythonde site-packages位置执行下面的python命令查看
import site
print(site.getsitepackages())我的位置是/Library/Python/2.7/site-packagessudo cp /usr/local/Cellar/opencv/3.3.0_3/lib/python2.7/site-packages/cv2.so /Library/Python/2.7/site-packages检查
import cv2
cv2.__version__

相关内容推荐