error on installation of opencv does not make sense
Question: when I run `brew install opencv` I get the following error:

    
    
    Error: undefined local variable or method `which_python' for #<Formula opencv (stable) /usr/local/Library/Formula/opencv.rb>
    

naturally I went to check this out by opening up
`/usr/local/Library/Formula/opencv.rb`. That showed the following ruby
declaration:

    
    
    def which_python
      "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
    end
    

so `which_python` is clearly defined. Just to check and make sure that works,
I opened up ruby to see if there was something wrong:

    
    
    1.9.3-p194 :005 > def which_python
    1.9.3-p194 :006?>     "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
    1.9.3-p194 :007?>   end
     => nil 
    1.9.3-p194 :008 > which_python
     => "python2.7" 
    

This verifies that `which_python` is defined correctly. Can somebody please
explain why this error is occurring and what I can do to get around this.


Answer: I resolved this with:

    
    
    rm /usr/local/Library/Formula/opencv.rb
    brew update
    brew doctor
    brew install opencv
    

I'm not sure if removing opencv.rb is needed.

