Skip to content

在 Mac OS X 上安装 Opencv3 (Python3.5) #20

Description

@nodejh

通过 homebrew 安装 opencv

通过 homebrew 安装在 Mac OS X 上安装为 Python3.5 安装 Opencv3:

$ brew install opencv3 --with-python3
......
......
This formula is keg-only, which means it was not symlinked into /usr/local.

opencv3 and opencv install many of the same files.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/opencv3/lib
    CPPFLAGS: -I/usr/local/opt/opencv3/include

==> Summary

安装完成后,会有如上提示。接下来需要做的事,将 opencv3site-packegs 链接到 Python3site-packegs:

echo /usr/local/opt/opencv3/lib/python3.5/site-packages >> /usr/local/lib/python3.5/site-packages/opencv3.pth

检查是否安装成功

$ python
>>> import cv2
>>> cv2.__version__
'3.1.0'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions