Tag Archives: Homebrew

Error while starting Jython in Mac

After I figured out how I can use Python to create Pig UDF functions, I got interested in Jython and wanted to play around with it. So I installed it in my Mac through homebrew by executing the following command.

brew install jython

Everything got installed properly, I was able to run Jython after setting
up the following lines in my [bashrc](https://github.com/sudar/dotfiles)

export JYTHON_HOME=$(brew --prefix jython)/libexec
export PATH=$PATH:$JYTHON_HOME/bin

But there was one small annoyance. Every time I was staring Jython, I was getting the following strange warning.

expr: syntax error

After a couple of web searches, I stumbled upon an email thread in the Jython-users mailing list. Basically it was due to a bug in the bash script that is used to start Jython. I opened /usr/local/Cellar/jython/2.5.3/libexec/bin/jython file and changed the line, which fixed the error.

if expr "$link" : '/' > /dev/null; then to if expr "$link" : '[/]' > /dev/null; then

I am exploring Jython more and will keep you guys updated, if I find something interesting.

Posted in Python | Tagged , , , | 1 Comment

Install OpenCV in Mac using Homebrew

Recently, I switched to a new Mac Retina (one of the numerous perks of working at Yahoo 😉 ) and wanted to install OpenCV in it using Homebrew.

I ran the usual brew install opencv command and got No available formula for opencv error message. I have personally ran this command before to install OpenCV and was wondering what went wrong.

After a couple of web searches and ‘hair tearing’, I found that the opencv formula has moved to homebrew-science and I had to do the following.

brew tap homebrew/science

brew install opencv

Finally everything worked. So even if you are facing the same problem, then you know what to do now (and possibly save some hair as well) 🙂

Oh, by the way, if you own a Mac and don’t know what Homebrew is, then stop everything and install it right away. You can thank me later 😉

Posted in Apple/Mac/iDevices | Tagged , , , | Leave a comment