ぴろの狂人日記

2014年から頑張ってブログを継続しようと思います。「継続と習慣」を今年の目標にしたので、頑張って更新を続けようと思います。おいおいはレビューや数学や認知科学などについて記事を書いていければと思っています

Macでpython3の環境構築13---OpenCV3のインストール1---

画像処理とかもやってみたいと思いOpenCVをインストールしようと思っておりました。

しかし、なかなかうまくいかず格闘。その結果なんとかインストールできたので、どうやってうまくできたのか、自分用のメモや勉強の意味も含め書いておきたいと思います。
結論から言えば、うまくいかなかったのはPATHが通っていなかったからなんですけどね。

まず、次のようにします。

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew install opencv3 --with-python3&nbsp
#「brew install opencv3 --with-python3」と打ってreturnを押す。


そうすると次のようになります。

==> Installing opencv3 from homebrew/homebrew-science
Error: You must `brew link openexr numpy' before homebrew/science/opencv3 can be installed


Errorがでてきます。
直訳とはなりますが、「homebrew/science/opencv3がインストールされる前に、"brew link openxr numpy"をしなければなりません。」という意味。

まあでは、「実際どうすればいいの?」というのはまた別の話ですが。とりあえず先へ進みます。

その次はこうします。正確な意味などはまだわかりませんが、(特に--with-python3の部分)とりあえず保留にし先へ進みます。

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew install numpy --with-python3    # 「brew install numpy --with-python3」と打ってreturnを押す。
 


そうするとこうなります。

Warning: homebrew/python/numpy-1.9.3 already installed, it's just not linked


今度はWarning。「homebrew/python/numpy-1.9.3は既にインストールされているけども、ただしリンクはされていません。」とのこと。

ではリンクさせましょう。ということで、先ほどのErrorにも表示されていましたが、どうやらlinkをするためにはbrew link openxr numpyをすればいいらしいので、素直にErrorの指示に従ってみます。

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew link openexr numpy                                                                                                                        # 「brew link openxr numpy」と打ってreturnを押す。


そうすると、こうなります。

Linking /usr/local/Cellar/openexr/2.2.0...
Error: Could not symlink share/aclocal/openexr.m4
/usr/local/share/aclocal is not writable.


ここでもまたError。symlinkできません。「/usr/local/share/aclocal には書き込みできません。」とのこと。
これは、現在のコマンドの実行者では、/usr/local/share/aclocalに書き込みできません、/usr/local/share/aclocalの権限を変更する必要があるようです。

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ sudo chown -R hiroshi   /usr/local/share/aclocal
#  「sudo chown -R hiroshi」と打ってreturnを押す。
#今自分の環境では「hiroshi」というユーザーでログインしてます。-Rのあとは、今ログインしているユーザーの名前を入れる。
# sudo chown -R hiroshi  というのは、その右に入力したファイルの権限をhiroshiに変更するという意味。
 


sudoをつけて実行しているので、パスワードを求められます。ここには自分のパソコンのパスワードを入れます。
今までみたいに、ずらずらと何か処理が始まるわけではありません。
また次のコマンドの入力待ちになるので、続けてこうします。

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew link openexr
# 「brew link openxr」と打ってreturnを押す。
#   とりあえずopenxrに対してだけbrew linkを行っておきます。


そうすると、こうなる。

Linking /usr/local/Cellar/openexr/2.2.0... 103 symlinks created

ということでこれは問題なく処理できました。

その上でさらに、

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew link openexr numpy

とします。
そうすると、

Warning: Already linked: /usr/local/Cellar/openexr/2.2.0        #この行は、openxrはすでにリンクされていますよ、という意味。上記の処理で、もう既にうまくいっているからね。
To relink: brew unlink openexr && brew link openexr     
Linking /usr/local/Cellar/numpy/1.9.3...        # numpyに対する処理。結局エラー。
Error: Could not symlink bin/f2py
Target /usr/local/bin/f2py
already exists. You may want to remove it:
  rm '/usr/local/bin/f2py'

To force the link and overwrite all conflicting files:
  brew link --overwrite numpy

To list all files that would be deleted:
  brew link --overwrite --dry-run numpy

となります。
openxrとnumpyそれぞれに対して処理が走ります。
openxrの方は、「もう既にリンクされています」と。確かに先ほど処理が無事できておりましたので、そうなりますね。
numpyの方はError

というかここまで、コマンドの打ち方が一貫していないですが、ぶっちゃけ、処理していた当時も現在も、完全に意味がわかっているわけではないので、ご勘弁ください。

でこのあとも、よく意味はわかってないので、詳しいコメントはしませんが、そのあと行った処理も記載しておきたいと思います。

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ rm '/usr/local/bin/f2py'       # rm はその右のファイルを削除する。
hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew link --overwrite numpy
Linking /usr/local/Cellar/numpy/1.9.3... 392 symlinks created
hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew link --overwrite --dry-run numpy
Warning: Already linked: /usr/local/Cellar/numpy/1.9.3
To relink: brew unlink numpy && brew link numpy
hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew link numpy
Warning: Already linked: /usr/local/Cellar/numpy/1.9.3
To relink: brew unlink numpy && brew link numpy


途中の部分の処理が一部理解できていない部分もありますが、
「Linking /usr/local/Cellar/numpy/1.9.3... 392 symlinks created」とあったり、「Warning: Already linked: /usr/local/Cellar/numpy/1.9.3」と出ているので、どうやらnumpyのリンクもできたようです。

これで、当初冒頭ででていた「brew install opencv3 --with-python3」の実行に対するErrorError: You must `brew link openexr numpy' before homebrew/science/opencv3 can be installed」に対する対策が一応できたはずなので、改めて「brew install opencv3 --with-python3」を実行してみます。

hiroshi-no-MacBook-Air:Pro-tr hiroshi$ brew install opencv3 --with-python3


そうすると今度は、こういう処理が始まります。

==> Installing opencv3 from homebrew/homebrew-science
==> Installing dependencies for homebrew/science/opencv3: cmake, pkg-config, homebrew/python/numpy
==> Installing homebrew/science/opencv3 dependency: cmake
==> Downloading https://homebrew.bintray.com/bottles/cmake-3.3.1.yosemite.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring cmake-3.3.1.yosemite.bottle.1.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/

Add the following to your init file to have packages installed by Homebrew added to your load-path:
(let ((default-directory "/usr/local/share/emacs/site-lisp/"))
  (normal-top-level-add-subdirs-to-load-path))
==> Summary
🍺  /usr/local/Cellar/cmake/3.3.1: 1901 files, 33M
==> Installing homebrew/science/opencv3 dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.28.yosemite.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.28.yosemite.bottle.2.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.28: 10 files, 612K
==> Installing homebrew/science/opencv3 dependency: homebrew/python/numpy
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://pypi.python.org/packages/source/n/numpy/numpy-1.9.3.tar.gz
######################################################################## 100.0%
==> Downloading https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz
######################################################################## 100.0%
==> python -c import setuptools... --no-user-cfg install --prefix=/usr/local/Cellar/numpy/1.9.3/libexec/nose --sin
==> python setup.py build --fcompiler=gnu95 install --prefix=/usr/local/Cellar/numpy/1.9.3
==> Downloading https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/numpy--nose-1.3.4.tar.gz
==> python3 -c import setuptools... --no-user-cfg install --prefix=/usr/local/Cellar/numpy/1.9.3/libexec/nose --si
==> python3 setup.py build --fcompiler=gnu95 install --prefix=/usr/local/Cellar/numpy/1.9.3
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink lib/python3.4/site-packages/numpy/__config__.py
Target /usr/local/lib/python3.4/site-packages/numpy/__config__.py
already exists. You may want to remove it:
  rm '/usr/local/lib/python3.4/site-packages/numpy/__config__.py'

To force the link and overwrite all conflicting files:
  brew link --overwrite numpy

To list all files that would be deleted:
  brew link --overwrite --dry-run numpy

Possible conflicting files are:
/usr/local/lib/python3.4/site-packages/numpy/__config__.py
/usr/local/lib/python3.4/site-packages/numpy/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/_import_tools.py
/usr/local/lib/python3.4/site-packages/numpy/add_newdocs.py
/usr/local/lib/python3.4/site-packages/numpy/compat/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/compat/_inspect.py
/usr/local/lib/python3.4/site-packages/numpy/compat/py3k.py
/usr/local/lib/python3.4/site-packages/numpy/compat/setup.py
/usr/local/lib/python3.4/site-packages/numpy/core/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/core/_dotblas.so
/usr/local/lib/python3.4/site-packages/numpy/core/_dummy.so
/usr/local/lib/python3.4/site-packages/numpy/core/_internal.py
/usr/local/lib/python3.4/site-packages/numpy/core/_methods.py
/usr/local/lib/python3.4/site-packages/numpy/core/arrayprint.py
/usr/local/lib/python3.4/site-packages/numpy/core/cversions.py
/usr/local/lib/python3.4/site-packages/numpy/core/defchararray.py
/usr/local/lib/python3.4/site-packages/numpy/core/fromnumeric.py
/usr/local/lib/python3.4/site-packages/numpy/core/function_base.py
/usr/local/lib/python3.4/site-packages/numpy/core/generate_numpy_api.py
/usr/local/lib/python3.4/site-packages/numpy/core/getlimits.py
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/__multiarray_api.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/__ufunc_api.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/_neighborhood_iterator_imp.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/_numpyconfig.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/arrayscalars.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/halffloat.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/multiarray_api.txt
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/noprefix.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_3kcompat.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_common.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_cpu.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_endian.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_interrupt.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_math.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_no_deprecated_api.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/npy_os.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/numpyconfig.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/old_defines.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/oldnumeric.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/ufunc_api.txt
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/ufuncobject.h
/usr/local/lib/python3.4/site-packages/numpy/core/include/numpy/utils.h
/usr/local/lib/python3.4/site-packages/numpy/core/info.py
/usr/local/lib/python3.4/site-packages/numpy/core/lib/libnpymath.a
/usr/local/lib/python3.4/site-packages/numpy/core/lib/npy-pkg-config/mlib.ini
/usr/local/lib/python3.4/site-packages/numpy/core/lib/npy-pkg-config/npymath.ini
/usr/local/lib/python3.4/site-packages/numpy/core/machar.py
/usr/local/lib/python3.4/site-packages/numpy/core/memmap.py
/usr/local/lib/python3.4/site-packages/numpy/core/multiarray.so
/usr/local/lib/python3.4/site-packages/numpy/core/multiarray_tests.so
/usr/local/lib/python3.4/site-packages/numpy/core/numeric.py
/usr/local/lib/python3.4/site-packages/numpy/core/numerictypes.py
/usr/local/lib/python3.4/site-packages/numpy/core/operand_flag_tests.so
/usr/local/lib/python3.4/site-packages/numpy/core/records.py
/usr/local/lib/python3.4/site-packages/numpy/core/scalarmath.so
/usr/local/lib/python3.4/site-packages/numpy/core/setup.py
/usr/local/lib/python3.4/site-packages/numpy/core/setup_common.py
/usr/local/lib/python3.4/site-packages/numpy/core/shape_base.py
/usr/local/lib/python3.4/site-packages/numpy/core/struct_ufunc_test.so
/usr/local/lib/python3.4/site-packages/numpy/core/test_rational.so
/usr/local/lib/python3.4/site-packages/numpy/core/tests/data/astype_copy.pkl
/usr/local/lib/python3.4/site-packages/numpy/core/tests/data/recarray_from_file.fits
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_abc.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_api.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_arrayprint.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_blasdot.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_datetime.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_defchararray.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_deprecations.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_dtype.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_einsum.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_errstate.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_function_base.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_getlimits.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_half.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_indexerrors.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_indexing.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_item_selection.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_machar.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_memmap.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_multiarray.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_multiarray_assignment.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_nditer.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_numeric.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_numerictypes.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_print.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_records.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_regression.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_scalarinherit.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_scalarmath.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_scalarprint.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_shape_base.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_ufunc.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_umath.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_umath_complex.py
/usr/local/lib/python3.4/site-packages/numpy/core/tests/test_unicode.py
/usr/local/lib/python3.4/site-packages/numpy/core/umath.so
/usr/local/lib/python3.4/site-packages/numpy/core/umath_tests.so
/usr/local/lib/python3.4/site-packages/numpy/ctypeslib.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/__config__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/__version__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/ccompiler.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/autodist.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/bdist_rpm.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/build.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/build_clib.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/build_ext.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/build_py.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/build_scripts.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/build_src.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/config.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/config_compiler.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/develop.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/egg_info.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/install.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/install_clib.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/install_data.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/install_headers.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/command/sdist.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/compat.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/conv_template.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/core.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/cpuinfo.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/environment.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/exec_command.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/extension.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/absoft.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/compaq.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/g95.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/gnu.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/hpux.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/ibm.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/intel.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/lahey.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/mips.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/nag.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/none.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/pathf95.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/pg.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/sun.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/fcompiler/vast.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/from_template.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/info.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/intelccompiler.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/lib2def.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/line_endings.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/log.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/mingw/gfortran_vs2003_hack.c
/usr/local/lib/python3.4/site-packages/numpy/distutils/mingw32ccompiler.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/misc_util.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/npy_pkg_config.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/numpy_distribution.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/pathccompiler.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/setup.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/system_info.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_ext/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_ext/setup.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_ext/src/fib1.f
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_ext/src/fib2.pyf
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_ext/tests/test_fib2.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_f90_ext/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_f90_ext/include/body.f90
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_f90_ext/setup.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_f90_ext/src/foo_free.f90
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/gen_ext/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/gen_ext/setup.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/gen_ext/tests/test_fib3.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/pyrex_ext/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/pyrex_ext/primes.pyx
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/pyrex_ext/setup.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/pyrex_ext/tests/test_primes.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/setup.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/setup.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/src/example.c
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/src/example.i
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/src/zoo.cc
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/src/zoo.h
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/src/zoo.i
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/tests/test_example.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/swig_ext/tests/test_example2.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/test_exec_command.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/test_fcompiler_gnu.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/test_fcompiler_intel.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/test_misc_util.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/tests/test_npy_pkg_config.py
/usr/local/lib/python3.4/site-packages/numpy/distutils/unixccompiler.py
/usr/local/lib/python3.4/site-packages/numpy/doc/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/doc/basics.py
/usr/local/lib/python3.4/site-packages/numpy/doc/broadcasting.py
/usr/local/lib/python3.4/site-packages/numpy/doc/byteswapping.py
/usr/local/lib/python3.4/site-packages/numpy/doc/constants.py
/usr/local/lib/python3.4/site-packages/numpy/doc/creation.py
/usr/local/lib/python3.4/site-packages/numpy/doc/glossary.py
/usr/local/lib/python3.4/site-packages/numpy/doc/howtofind.py
/usr/local/lib/python3.4/site-packages/numpy/doc/indexing.py
/usr/local/lib/python3.4/site-packages/numpy/doc/internals.py
/usr/local/lib/python3.4/site-packages/numpy/doc/io.py
/usr/local/lib/python3.4/site-packages/numpy/doc/jargon.py
/usr/local/lib/python3.4/site-packages/numpy/doc/methods_vs_functions.py
/usr/local/lib/python3.4/site-packages/numpy/doc/misc.py
/usr/local/lib/python3.4/site-packages/numpy/doc/performance.py
/usr/local/lib/python3.4/site-packages/numpy/doc/structured_arrays.py
/usr/local/lib/python3.4/site-packages/numpy/doc/subclassing.py
/usr/local/lib/python3.4/site-packages/numpy/doc/ufuncs.py
/usr/local/lib/python3.4/site-packages/numpy/dual.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/__version__.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/auxfuncs.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/capi_maps.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/cb_rules.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/cfuncs.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/common_rules.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/crackfortran.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/diagnose.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/f2py2e.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/f2py_testing.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/f90mod_rules.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/func2subr.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/info.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/rules.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/setup.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/src/fortranobject.c
/usr/local/lib/python3.4/site-packages/numpy/f2py/src/fortranobject.h
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/assumed_shape/foo_free.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/assumed_shape/foo_mod.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/assumed_shape/foo_use.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/assumed_shape/precision.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/kind/foo.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/mixed/foo.f
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/mixed/foo_fixed.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/mixed/foo_free.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/regression/inout.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/src/size/foo.f90
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_array_from_pyobj.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_assumed_shape.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_callback.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_kind.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_mixed.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_regression.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_return_character.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_return_complex.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_return_integer.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_return_logical.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_return_real.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/test_size.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/tests/util.py
/usr/local/lib/python3.4/site-packages/numpy/f2py/use_rules.py
/usr/local/lib/python3.4/site-packages/numpy/fft/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/fft/fftpack.py
/usr/local/lib/python3.4/site-packages/numpy/fft/fftpack_lite.so
/usr/local/lib/python3.4/site-packages/numpy/fft/helper.py
/usr/local/lib/python3.4/site-packages/numpy/fft/info.py
/usr/local/lib/python3.4/site-packages/numpy/fft/setup.py
/usr/local/lib/python3.4/site-packages/numpy/fft/tests/test_fftpack.py
/usr/local/lib/python3.4/site-packages/numpy/fft/tests/test_helper.py
/usr/local/lib/python3.4/site-packages/numpy/lib/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/lib/_compiled_base.so
/usr/local/lib/python3.4/site-packages/numpy/lib/_datasource.py
/usr/local/lib/python3.4/site-packages/numpy/lib/_iotools.py
/usr/local/lib/python3.4/site-packages/numpy/lib/_version.py
/usr/local/lib/python3.4/site-packages/numpy/lib/arraypad.py
/usr/local/lib/python3.4/site-packages/numpy/lib/arraysetops.py
/usr/local/lib/python3.4/site-packages/numpy/lib/arrayterator.py
/usr/local/lib/python3.4/site-packages/numpy/lib/financial.py
/usr/local/lib/python3.4/site-packages/numpy/lib/format.py
/usr/local/lib/python3.4/site-packages/numpy/lib/function_base.py
/usr/local/lib/python3.4/site-packages/numpy/lib/index_tricks.py
/usr/local/lib/python3.4/site-packages/numpy/lib/info.py
/usr/local/lib/python3.4/site-packages/numpy/lib/nanfunctions.py
/usr/local/lib/python3.4/site-packages/numpy/lib/npyio.py
/usr/local/lib/python3.4/site-packages/numpy/lib/polynomial.py
/usr/local/lib/python3.4/site-packages/numpy/lib/recfunctions.py
/usr/local/lib/python3.4/site-packages/numpy/lib/scimath.py
/usr/local/lib/python3.4/site-packages/numpy/lib/setup.py
/usr/local/lib/python3.4/site-packages/numpy/lib/shape_base.py
/usr/local/lib/python3.4/site-packages/numpy/lib/stride_tricks.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/data/python3.npy
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/data/win64python2.npy
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test__datasource.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test__iotools.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test__version.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_arraypad.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_arraysetops.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_arrayterator.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_financial.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_format.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_function_base.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_index_tricks.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_io.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_nanfunctions.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_polynomial.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_recfunctions.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_regression.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_shape_base.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_stride_tricks.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_twodim_base.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_type_check.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_ufunclike.py
/usr/local/lib/python3.4/site-packages/numpy/lib/tests/test_utils.py
/usr/local/lib/python3.4/site-packages/numpy/lib/twodim_base.py
/usr/local/lib/python3.4/site-packages/numpy/lib/type_check.py
/usr/local/lib/python3.4/site-packages/numpy/lib/ufunclike.py
/usr/local/lib/python3.4/site-packages/numpy/lib/user_array.py
/usr/local/lib/python3.4/site-packages/numpy/lib/utils.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/_umath_linalg.so
/usr/local/lib/python3.4/site-packages/numpy/linalg/info.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/lapack_lite.so
/usr/local/lib/python3.4/site-packages/numpy/linalg/linalg.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/setup.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/tests/test_build.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/tests/test_deprecations.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/tests/test_linalg.py
/usr/local/lib/python3.4/site-packages/numpy/linalg/tests/test_regression.py
/usr/local/lib/python3.4/site-packages/numpy/ma/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/ma/bench.py
/usr/local/lib/python3.4/site-packages/numpy/ma/core.py
/usr/local/lib/python3.4/site-packages/numpy/ma/extras.py
/usr/local/lib/python3.4/site-packages/numpy/ma/mrecords.py
/usr/local/lib/python3.4/site-packages/numpy/ma/setup.py
/usr/local/lib/python3.4/site-packages/numpy/ma/tests/test_core.py
/usr/local/lib/python3.4/site-packages/numpy/ma/tests/test_extras.py
/usr/local/lib/python3.4/site-packages/numpy/ma/tests/test_mrecords.py
/usr/local/lib/python3.4/site-packages/numpy/ma/tests/test_old_ma.py
/usr/local/lib/python3.4/site-packages/numpy/ma/tests/test_regression.py
/usr/local/lib/python3.4/site-packages/numpy/ma/tests/test_subclassing.py
/usr/local/lib/python3.4/site-packages/numpy/ma/testutils.py
/usr/local/lib/python3.4/site-packages/numpy/ma/timer_comparison.py
/usr/local/lib/python3.4/site-packages/numpy/ma/version.py
/usr/local/lib/python3.4/site-packages/numpy/matlib.py
/usr/local/lib/python3.4/site-packages/numpy/matrixlib/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/matrixlib/defmatrix.py
/usr/local/lib/python3.4/site-packages/numpy/matrixlib/setup.py
/usr/local/lib/python3.4/site-packages/numpy/matrixlib/tests/test_defmatrix.py
/usr/local/lib/python3.4/site-packages/numpy/matrixlib/tests/test_multiarray.py
/usr/local/lib/python3.4/site-packages/numpy/matrixlib/tests/test_numeric.py
/usr/local/lib/python3.4/site-packages/numpy/matrixlib/tests/test_regression.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/_polybase.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/chebyshev.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/hermite.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/hermite_e.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/laguerre.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/legendre.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/polynomial.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/polytemplate.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/polyutils.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/setup.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_chebyshev.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_classes.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_hermite.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_hermite_e.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_laguerre.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_legendre.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_polynomial.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_polyutils.py
/usr/local/lib/python3.4/site-packages/numpy/polynomial/tests/test_printing.py
/usr/local/lib/python3.4/site-packages/numpy/random/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/random/info.py
/usr/local/lib/python3.4/site-packages/numpy/random/mtrand.so
/usr/local/lib/python3.4/site-packages/numpy/random/randomkit.h
/usr/local/lib/python3.4/site-packages/numpy/random/setup.py
/usr/local/lib/python3.4/site-packages/numpy/random/tests/test_random.py
/usr/local/lib/python3.4/site-packages/numpy/random/tests/test_regression.py
/usr/local/lib/python3.4/site-packages/numpy/setup.py
/usr/local/lib/python3.4/site-packages/numpy/testing/__init__.py
/usr/local/lib/python3.4/site-packages/numpy/testing/decorators.py
/usr/local/lib/python3.4/site-packages/numpy/testing/noseclasses.py
/usr/local/lib/python3.4/site-packages/numpy/testing/nosetester.py
/usr/local/lib/python3.4/site-packages/numpy/testing/print_coercion_tables.py
/usr/local/lib/python3.4/site-packages/numpy/testing/setup.py
/usr/local/lib/python3.4/site-packages/numpy/testing/tests/test_decorators.py
/usr/local/lib/python3.4/site-packages/numpy/testing/tests/test_doctesting.py
/usr/local/lib/python3.4/site-packages/numpy/testing/tests/test_utils.py
/usr/local/lib/python3.4/site-packages/numpy/testing/utils.py
/usr/local/lib/python3.4/site-packages/numpy/tests/test_ctypeslib.py
/usr/local/lib/python3.4/site-packages/numpy/tests/test_matlib.py
/usr/local/lib/python3.4/site-packages/numpy/version.py
==> Caveats
Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
  mkdir -p /Users/hiroshi/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/hiroshi/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Summary
🍺  /usr/local/Cellar/numpy/1.9.3: 1379 files, 28M, built in 3.7 minutes
==> Installing homebrew/science/opencv3
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://github.com/Itseez/opencv/archive/3.0.0.tar.gz
==> Downloading from https://codeload.github.com/Itseez/opencv/tar.gz/3.0.0
######################################################################## 100.0%
==> Downloading https://downloads.sourceforge.net/project/opencvlibrary/3rdparty/ippicv/ippicv_macosx_20141027.tgz
==> Downloading from http://netassist.dl.sourceforge.net/project/opencvlibrary/3rdparty/ippicv/ippicv_macosx_20141
######################################################################## 100.0%
==> cmake .. -DCMAKE_C_FLAGS_RELEASE= -DCMAKE_CXX_FLAGS_RELEASE= -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv3/
==> make
==> make install
==> Caveats
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

If you need Python to find bindings for this keg-only formula, run:
  echo /usr/local/opt/opencv3/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth
  mkdir -p /Users/hiroshi/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/hiroshi/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Summary
🍺  /usr/local/Cellar/opencv3/3.0.0: 247 files, 104M, built in 17.0 minutes


で、一応処理が終わりました。
実際、無事インストールできているかどうか確認するためにはターミナルからpythonを起動してcv2というモジュールがインストールできるかどうか確認すればいいようです。
しかし

hiroshi-no-MacBook-Air:~ hiroshi$ python3
Python 3.4.3 (default, Aug 11 2015, 08:57:25) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'cv2'

Errorがでてしまう。

ここから試行錯誤が始まりますが、長くなったので続きは次回で。
(結論から言えば PATHと通すだけで改善したんですけどね。。。)