Tech Notes: How to install SimpleCV on Mac(Mavericks)

Thu 07 August 2014
By leon

Document of a painful installation procedure, so hopefully someone saves the hassle to get SimpleCV working on my Mac Mavericks

There seems to be a lot of partial pieces of advice on installation in t'internet. So this is a filleted copy of my command history, I case I have to do this again.

Blindly pasting in these command one by one probably wont fix things for you.

Install simplecv

First I optimistically tried to install SimpleCV.

http://sourceforge.net/projects/simplecv/files/latest/download?source=files Download simple cv unpack and

$ python ./setup.py install

Blindly hoping that all requirements would be magically satisfied -- Obviously that didn't work :-/

I did have an install but errors when I ran the 'simplecv' command.

Needed to satisfy the missing requirements in order for SimpleCV to run.

Install pygame

satisfy requirements for pygame

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi

lot of problems linking with libjpeg libpng after this. problem was due to permissions of this folder /usr/local/share/man/man5 relax the security on /usr/local/share/man/man5 (there are better ways than 777 I know eg chmod +w)

sudo chmod 777 /usr/local/share/man/man5

Then I have a error

Error: undefined method `opt_include' for jpeg:Jpeg

Then install pygame from source

pip install hg+http://bitbucket.org/pygame/pygame

You'll need mercurial(hg) installed first to do this btw

brew install mercurial

Install opencv

A homebrew install of opencv didn't work for me

brew install opencv

Instead I installed open cv from source you'll need to install cmake first.

Download opencv from

http://opencv.org/downloads.html mac/linux version

Unzip it and cd into the directory. Then build and install...

$ mkdir build
$ cd build
$ cmake -G "Unix Makefiles" ..
$ make -j8
$ sudo make install

But still I was getting this error:

ImportError: Cannot load OpenCV library which is required by SimpleCV

Solved by symlinking cv.py and cv2.so into the virtualenv

$ ln -s /usr/local/lib/python2.7/site-packages/cv2.so lib/python2.7/site-packages/cv2.so
$ ln -s /usr/local/lib/python2.7/site-packages/cv.py lib/python2.7/site-packages/cv.py

Install other required python libs via pip

$ pip install numpy scipy ipython

This worked for me (hopefully it will help you) :-) Here is the output from pip for version number reference

$ pip install IPython
$ pip freeze
SimpleCV==1.3
gnureadline==6.3.3
ipython==2.2.0
numpy==1.8.1
pygame==1.9.2a0
scipy==0.14.0
wsgiref==0.1.2

now let's try out SimpleCV....

Proudly powered by Pelican, and Python. Reading Room Theme by Leon Harris