LoginSignup
1
2

More than 5 years have passed since last update.

Homebrew で Python3, numpy, OpenCV3 を macOS 10.14 Mojave にインストール

Posted at

Python3, numpy, OpenCV3 を macOS 10.14 Mojave へインストールした時のメモです。
特に詰まることもなく簡単にできると思います。

下記ページを参考にしました。
Homebrewで Python3 OpenCV3をMacにインストール

環境

  • macOS Mojave
  • Homebrew
  • Python3.6
  • OpenCV3.4.3

Homebrew のインストール

Homebrew 公式サイトの記載通りにコマンド実行します。

Homebrewインストール
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Python3 のインストール

Homebrew で Python3 をインストールします。

Python3インストール
brew install python3

numpy のインストール

OpenCV3はnumpyを使用するようなのでインストールしておく。

Python3インストール
pip3 install numpy

OpenCV3 のインストール

pip3 で OpenCV3 をインストールします。

opencv3インストール
brew install opencv3 --with-python3

OpenCV3 の動作確認

最後に、 OpenCV が import できればインストール成功です。

OpenCVをimportしてみる
$ Python3
>>> import cv2
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2