23

I'm using homebrew installing opencv3 on OSX(EI Captain),

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

and an error occurred:

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

Can u guys help me find out how to fix it?

4 Answers 4

19

I do brew edit opencv3, then comment the following line

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

then you can reinstall again with --HEAD

The opencv repository has fix some issue also removed file 3rdparty/ippicv/downloader.cmake, so no need to patch it any more. But they didn't issue a new release, so to install --with-contrib, you have to install with --HEAD, but disable the patch of file 3rdparty/ippicv/downloader.cmake

Sign up to request clarification or add additional context in comments.

4 Comments

This worked for me, but FYI you've got a typo in the code block (ippicv/ippicv.cmake should be ippicv/downloarder.cmake)
what is --HEAD and why do we want it?
If --HEAD is passed, and formula defines it, install the HEAD version, aka master, trunk, unstable. In this OpenCV case, it download source from github, compile and install
OK I find out about HEAD,. --HEAD : "Rather than compiling a tagged OpenCV release (i.e., v3.0, v3.1, etc.) the --HEAD switch instead clones down the bleeding-edge version of OpenCV from GitHub. Why would we bother doing this? Simple. We need to avoid the QTKit error that plagues macOS Sierra systems with the current tagged OpenCV 3 releases (please see the “Avoiding the QTKit/QTKit.h file not found error” section of this blog post for more information)"
8

I experienced the same problem. I solved it by running brew install opencv3 --with-contrib --with-python3

I think what happened is that people updated the ../3rdparty/ippicv folder in the repo such that the downloader.cmake file is no longer there, but they have not yet updated the brew formula.

brew install without --HEAD will build opencv3.2.0 which is good enough for me.

2 Comments

what is --HEAD anyway ?
I learned about HEAD now. it is a bleeding edge github version to avoid certain errors (particularly with mac os sierra QTKit)
4

When I searched for the OpenCV Java issue this was the first result. I am posting my answer for anyone using the OpenCV Java to find it useful, too.

I was following this article: https://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html

brew tap homebrew/science 
brew install opencv3 --HEAD --with-contrib --with-java

I tried by removing --HEAD from the above command and I was able to install it sucessfully.

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

as per this post: https://github.com/Homebrew/homebrew-science/issues/5498

Comments

1

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/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.