三部曲:
1.安装opencv3
brew install opencv3
2.找到opencv3的安装路径,找到你python的安装路径
我的opencv3路径是:/usr/local/opt/opencv3/lib/python3.6/site-packages,
我的python路径是:/Users/yeshuai/anaconda3/lib/python3.6/site-packages
执行:
echo /usr/local/opt/opencv3/lib/python3.6/site-packages >> /Users/yeshuai/anaconda3/lib/python3.6/site-packages/opencv3.pth(相当于将前面那个路径写到后面路径那个文本文件中)
如果你发现/Users/yeshuai/anaconda3/lib/python3.6/site-packages/下有一个opencv3.pth文件,并且文件中的内容是/usr/local/opt/opencv3/lib/python3.6/site-packages就成功了
参考:
1.mac安装opencv
2.pyhton代码实现
3.anaconda切换环境
环境搞得真是蛋疼,马德!
mac安装opencv
最新推荐文章于 2024-08-28 23:25:20 发布