Install opencv 3.3.1 (previous version) with homebrew - opencv

I have an issue with not being able to use an integral piece of software due to its dependancy and being compiled with a previous version of opencv. When installing new opencv using homebrew brew install opencv I am getting the latest version 3.4. Is there anyway to install a previous version? Edit: On MacOS.

For others with the same problem:
$ brew install opencv#3

See this other answer about installing different versions of homebrew packages.
Homebrew install specific version of formula?

Related

How to install a particular version of opencv from homebrew?

How to install a particular version of OpenCV from homebrew?
I wanna install OpenCV 3
brew install opencv#3 would be what you are looking for. The formula source code is in here.

How are different package versions supported in homebrew?

homebrew supports the installation of different versions of a package.
Homebrew install specific version of formula?
But I don't see different versions specified in homebrew formulas.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/bash.rb
Does anybody know how the support of different versions of a package is implemented in homebrew? Thanks.
There is at least three different ways package versions are supported by Homebrew.
1) With brew switch, you can switch back to a version of a package you already installed. For example typing brew switch ansible, I obtain:
ansible installed versions: 2.7.5, 2.7.6
using brew switch ansible 2.7.5, I can switch back to an old version, but this works only for versions that have been already installed.
2) With versioned formulas, you can choose an old version of MySQL with brew install mysql#5.5 or brew install mysql#5.6. This works because there is the corresponding formulas: mysql#5.5.rb and mysql#5.6.rb.
3) You can use the git history to go back to any version of a formula, read this question/answer for details: Install older version of Pandoc (<2) using homebrew

Downgrade OpenCV using HomeBrew when brew versions is deleted

I am using the latest version (1.8.2) of homebrew and I am trying to downgrade opencv 3.4.3 to 3.4.0.
I followed this answer homebrew install specific version of formula? However, the problem is that even after I brew tap homebrew/boneyard, brew versions opencv still does not work.
How can I make 'brew versions' work for homebrew 1.8.2?
If that does not work, can I manually download and set up opencv 3.4.0 to homebrew?

Homebrew - Python3.7 replace Python3.6.5 if you brew install opencv2

I installed Python 3.6 using a direct link (brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rbbrew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb), since Brew now install by default 3.7 version, if I use brew install python3
Although if I install OpenCv2 from Brew; I get also Python 3.7, and that version get linked as default, moving 3.6 aside. I did try to brew link the previous version, but then when I import cv2, I get an error that the package does not exist.
If I run brew install opencv It tell me that the packages are already installed; so Python 3.6 can't import it, but 3.7 can.
I thought it is a problem with PATH but even that does not seem to have effect.
is there a way to tell brew to not update python when installing new packages? I am OK with 3.7 being installed; but I would like to be able to use OpenCV2 from both; while now I can only import it using 3.7 and not 3.6
brew pin python will prevent it from being upgraded. OpenCV will need to be installed with --build-from-source since the bottle is built and tested against the latest python formula.

PhantomJS version 1.4.0 version issue

I installed PhantomJS today and got this error trying to use it:
PhantomJS version 1.4.0
is too old. You must use at least version 1.7.0
(Capybara::Poltergeist::PhantomJSTooOld)
How can I install the newer version?
I can get the newer version (1.7) at: http://phantomjs.org/download.html
Once I've downloaded it though how do I actually install it?
Are you using Linux or OS X? You'll need to either build from source or install an updated PhantomJS package. You can also download the binaries and install over the system installed PhantomJS. Type "which phantomjs" and it should show the location of PhantomJS.
If you're using homebrew, just:
brew upgrade phantomjs
I had to solve this problem yesterday, it required me updating brew, telling brew to uninstall phantomJS, then updating xcode, then installing the latest xcode command utilities, then using brew to re-install phantomjs. Finally that got it to pull in the latest version. You might try this (mac):
brew update
brew uninstall phantomjs
brew doctor (follow the fixes it recommends if any... Mine was updating xcode)
brew install phantomjs
At that point it should grab the latest.
Good luck!

Resources