Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in installing opencv3 with homebrew and python3

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?

like image 376
SKSKSKSK Avatar asked Mar 30 '17 09:03

SKSKSKSK


Video Answer


4 Answers

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

like image 186
yjmade Avatar answered Oct 18 '22 18:10

yjmade


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.

like image 27
wenxi Avatar answered Oct 18 '22 18:10

wenxi


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

like image 4
Siva Avatar answered Oct 18 '22 19:10

Siva


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/

like image 1
Biranchi Avatar answered Oct 18 '22 19:10

Biranchi