install opencv3 on mac for python 3.6

一个人想着一个人 提交于 2019-12-20 18:30:10

问题


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??


回答1:


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




回答2:


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




回答3:


I also had the same issue and I have resolved the issue in the following way:

$ brew edit opencv3

Find the following code block and comment all the 4 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

Finally install using the brew install command:

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

Reference: http://www.pyimagesearch.com/2017/05/15/resolving-macos-opencv-homebrew-install-errors/



来源:https://stackoverflow.com/questions/43666806/install-opencv3-on-mac-for-python-3-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!