mac os, python 3.7 安装opencv3

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/w5688414/article/details/83658866

感想

programmer在做事情的时候,最厌烦的就是安装这个安装那个了,我也是,然后我发现安装opencv到python3也不是很容易,我这里分享一下我的简洁方法。

首先你要安装xcode和home brew,xcode直接在应用商店里面找哈,homebrew安装如下:

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update

opencv for python3 安装

brew tap homebrew/science
$ brew install opencv3 --with-contrib --with-python3 --HEAD

然后就成功了哈。我的输出为:

➜  ~ python3
Python 3.7.0 (default, Oct  2 2018, 09:20:07)
[Clang 10.0.0 (clang-1000.11.45.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>>

参考文献

[1].Install OpenCV 3 on macOS with Homebrew (the easy way). https://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/

猜你喜欢

转载自blog.csdn.net/w5688414/article/details/83658866
今日推荐