使用自制软件和python3

时间:2017-03-30 09:02:27

标签: opencv cmake homebrew opencv3.0 opencv3.1

我在OSX上使用自制软件安装opencv3(EI Captain),

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

并发生错误:

Updating Homebrew...
==> Installing opencv3 from homebrew/science
==> Cloning https://github.com/opencv/opencv.git
Updating /Users/ksun/Library/Caches/Homebrew/opencv3--git
==> Checking out branch master
==> Cloning https://github.com/opencv/opencv_contrib.git
Updating /Users/ksun/Library/Caches/Homebrew/opencv3--contrib--git
> ==> Checking out branch master
Error: No such file or directory - /private/tmp/opencv3-20170330-14255-bxsn05/3rdparty/ippicv/downloader.cmake

你们可以帮我找出解决方法吗?

4 个答案:

答案 0 :(得分:19)

我做brew edit opencv3,然后评论以下一行

inreplace buildpath/"3rdparty/ippicv/downloader.cmake",
  "${OPENCV_ICV_PLATFORM}-${OPENCV_ICV_PACKAGE_HASH}",
  "${OPENCV_ICV_PLATFORM}"

然后您可以使用--HEAD

重新安装

opencv存储库修复了一些问题,也删除了文件3rdparty/ippicv/downloader.cmake,因此无需再修补它。但他们没有发布新版本,因此要安装--with-contrib,您必须使用--HEAD进行安装,但要禁用文件补丁3rdparty/ippicv/downloader.cmake

答案 1 :(得分:8)

我遇到了同样的问题。我通过运行brew install opencv3 --with-contrib --with-python3

解决了这个问题

我认为发生的事情是人们更新了回购邮件中的 ../ 3rdparty / ippicv 文件夹,以致 downloader.cmake 文件不再存在,但他们还没有更新酿造配方。

没有--HEAD的brew安装将构建opencv3.2.0,这对我来说已经足够了。

答案 2 :(得分:3)

当我搜索OpenCV java问题时,这是第一个结果。如果有人使用OpenCV Java,那么发布我的答案就会对他们有用。

我正在关注这篇文章:https://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html

酿造自制土豆/科学 brew install opencv3 --HEAD --with-contrib --with-java

我尝试从上面的命令中删除--Head,并且我能够成功安装它。

brew install opencv3 --with-contrib --with-java

根据这篇文章:https://github.com/Homebrew/homebrew-science/issues/5498

答案 3 :(得分:1)

我已通过以下方式解决了该问题:

$ brew edit opencv3

找到以下代码块并注释所有4行:

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

最后使用brew install命令安装:

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

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