Skip to content

Instantly share code, notes, and snippets.

@ssahu
Forked from frederikhermans/gist:8561382
Created April 9, 2014 14:29
Show Gist options
  • Save ssahu/10276944 to your computer and use it in GitHub Desktop.
Save ssahu/10276944 to your computer and use it in GitHub Desktop.

Installing opencv fails, even though $ brew doctor doesn't have any complaints:

$ brew install opencv
==> Downloading https://github.com/Itseez/opencv/archive/2.4.7.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.7.1.tar.gz
==> Patching
patching file cmake/OpenCVFindOpenNI.cmake
Warning: Formula#python is deprecated and will go away shortly.
Error: undefined method `incdir' for #<PythonDependency: "python" []>
Please report this bug:
    https://github.com/Homebrew/homebrew/wiki/troubleshooting
/usr/local/Library/Formula/opencv.rb:50:in `install'
/usr/local/Library/Homebrew/build.rb:165:in `install'
/usr/local/Library/Homebrew/formula.rb:272:in `brew'
/usr/local/Library/Homebrew/formula.rb:617:in `stage'
/usr/local/Library/Homebrew/resource.rb:63:in `unpack'
/usr/local/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/usr/local/Library/Homebrew/resource.rb:60:in `unpack'
/usr/local/Library/Homebrew/resource.rb:53:in `stage'
/usr/local/Library/Homebrew/formula.rb:615:in `stage'
/usr/local/Library/Homebrew/formula.rb:267:in `brew'
/usr/local/Library/Homebrew/build.rb:144:in `install'
/usr/local/Library/Homebrew/build.rb:45:in `main'
/usr/local/Library/Homebrew/build.rb:12
/usr/local/Library/Formula/opencv.rb:81

Looking at the commit history, you can see an entry PythonDependency: massive refactoring.:

commit b3f4929f9d753ec7fb587cfbb065884d659fb81f
Author: Mike McQuaid <[email protected]>
Date:   Sat Jan 4 13:18:42 2014 +0000

    PythonDependency: massive refactoring.

    Closes #24842.

commit 0313168fc9287710c22e792c5581cd545ae52b59
Author: Mike McQuaid <[email protected]>
Date:   Mon Jan 20 15:26:18 2014 -0800

    bottle: only print relocations with --verbose.

Let's roll back to the commit just before that:

$ cd /usr/local
$ git reset --hard 0313168fc9287710c22e792c5581cd545ae52b59
HEAD is now at 0313168 bottle: only print relocations with --verbose.

Try again to build opencv:

$ brew install opencv
==> Downloading https://github.com/Itseez/opencv/archive/2.4.7.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.7.1.tar.gz
==> Patching
patching file cmake/OpenCVFindOpenNI.cmake
==> cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.7.1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=O
==> make
==> make install
==> Caveats
Set PYTHONPATH if you want Python to find your site-packages:
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
==> Summary
🍺  /usr/local/Cellar/opencv/2.4.7.1: 217 files, 40M, built in 3.9 minute

Hooray! Now let's go back to the latest brew version: $ brew update .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment