文章作者:Tyan
博客:noahsnail.com | CSDN | 简书
1. brew安装opencv
1 | brew install homebrew/science/opencv |
2. 把opencv添加到python中
执行下面的命令,或直接将/usr/local/Cellar/opencv3/3.1.0_4/lib/python2.7/site-packages/
下的cv2.so拷贝到/Users/ltc/anaconda/lib/python2.7/site-packages/
目录中。
1 | echo /usr/local/Cellar/opencv3/3.1.0_4/lib/python2.7/site-packages/ >> /Users/ltc/anaconda/lib/python2.7/site-packages/opencv3.pth |
3. 测试
1 | $ python |
不报错,安装成功。