user1532761
user1532761

Reputation: 39

Installing Older version of OpenCv 2.4.4 with HomeBrew

I need to use version OpenCV 2.4.4 for my project but for some reason I am not able to install it with homebrew.

When I run homebrew versions opencv I get:

/usr/local$ brew versions opencv
2.4.5    git checkout ae74fe9 /usr/local/Library/Taps/homebrew-science/opencv.rb
2.4.4a   git checkout 3efa797 /usr/local/Library/Taps/homebrew-science/opencv.rb
2.4.4    git checkout d85d011 /usr/local/Library/Taps/homebrew-science/opencv.rb
2.4.3    git checkout 8cb3f45 /usr/local/Library/Taps/homebrew-science/opencv.rb
2.4.2    git checkout b64b319 /usr/local/Library/Taps/homebrew-science/opencv.rb
2.4.1    git checkout 3d32cf1 /usr/local/Library/Taps/homebrew-science/opencv.rb
2.4.0    git checkout 2a8c46b /usr/local/Library/Taps/homebrew-science/opencv.rb
2.3.1a   git checkout cdaf83d /usr/local/Library/Taps/homebrew-science/opencv.rb
2.2      git checkout 032047f /usr/local/Library/Taps/homebrew-science/opencv.rb
2.1.1-pre git checkout 2438f42 /usr/local/Library/Taps/homebrew-science/opencv.rb
HEAD     git checkout c658897 /usr/local/Library/Taps/homebrew-science/opencv.rb
2.1.0    git checkout ecb6a3e /usr/local/Library/Taps/homebrew-science/opencv.rb
/usr/local$  git checkout d85d011 /usr/local/Library/Taps/homebrew-science/opencv.rb

but then when I run:

git checkout d85d011 /usr/local/Library/Taps/homebrew-science/opencv.rb

I get:

error: pathspec 'd85d011' did not match any file(s) known to git.
error: pathspec 'Library/Taps/homebrew-science/opencv.rb' did not match any file(s) known to git.

Upvotes: 1

Views: 4713

Answers (2)

Madhav
Madhav

Reputation: 751

In case someone wants to install some other version of opencv through homebrew you can find suitable version of opencv.rb through https://github.com/Homebrew/homebrew-science/commits/master/opencv.rb

Like 0fb1904 is for 2.4.11_2

If git checkout does not works for you, you can also copy the file content manually.(Take backup of existing opencv.rb to be safe)

Upvotes: 0

Codelism
Codelism

Reputation: 184

I am running into this issue as well. To switch to the specific branch (2.4.4, or 2.4.3), you have to navigate to the correct git folder. In this case you want to go to homebrew-science subfolder.

  1. cd /usr/local/Library/Taps/homebrew-science

  2. git checkout d85d011 opencv.rb to checkout branch 2.4.4

  3. brew install opencv (You may need to run brew unlink opencv if you have already installed some other versions)

Upvotes: 12

Related Questions