Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install opencv3 on mac for python 3.6

I want to install opencv3 for python 3.6 on macOS Sierra. I have tried to use it through homebrew using this link http://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/ but I am getting this error

Error: opencv3: Does not support building both Python 2 and 3 wrappers

How to resolve this??

like image 330
LookingForSomething Avatar asked Apr 27 '17 19:04

LookingForSomething


People also ask

How do I install the latest version of Python on Mac?

Install Python 3 with the Official Installer First, download an installer package from the Python website. To do that, visit https://www.python.org/downloads/ on your Mac; it detects your operating system automatically and shows a big button for downloading the latest version of Python installer on your Mac.


2 Answers

brew install opencv3 --with-contrib --with-python3 --without-python

like image 140
bianbian Avatar answered Oct 19 '22 23:10

bianbian


this error is caused by this commit.

With brew edit opencv3 you have to comment the four lines:

if build.with?("python3") && build.with?("python")
  # Opencv3 Does not support building both Python 2 and 3 versions
  odie "opencv3: Does not support building both Python 2 and 3 wrappers"
end

save and rerun the installation:

brew install opencv3 --with-contrib --with-python3

after that everything works for me

like image 23
Aldo D'Eramo Avatar answered Oct 19 '22 23:10

Aldo D'Eramo