3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

怠惰な人に贈る「M1 MacでOpenCV」

3
Last updated at Posted at 2021-02-03

※注意

2021/03/11 現在、この方法で入れたopencvをimportするとPythonが落ちます。
今日遭遇したところで原因がわかっていないので解決するまではこの方法は使えません。

TL;DR

$ brew install opencv

説明

Appleが発売したM1チップを載せたMac製品で pip を使って opencv-python を入れようとすると失敗します。Qiitaにある記事を色々と読み漁って見ると対策は「Dockerを使う」あるいは「condaを入れてビルドする」という内容ばかりです。「PreviewのDocker入れるのはちょっとな......」とか「condaで環境汚したくないな......」 という極めて怠惰な私は一人で勝手にゴネてました。

ところがよくよく見てみたらHomebrewの opencv Formula が入るっぽいので入れてみたら普通に使えたので、これが一番ラクです。環境を汚すことなく OpenCV が使えます。やったね。

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?