Installing CSSTidy and Scons on OS X or Linux Posted on 2009-01-02 by Dave Fowler

I'm setting up django-compress, and incredibly helpful django tool for compressing media files. By default it requires the installation of CSSTidy which was not as smooth of a task as most. Here are my notes.

Installing Scons

To install CSSTidy you have to have Scons in order to install it. Scons is similar to Make but uses python and probably has a ton of other differences as well. The following will install scons.

tar -xzvf scons-1.2.0.tar.gz
cd scons-1.2.0
sudo python install --standard-lib

I took me a short while to discover the need to use the --standard-lib flag. If you do not scons is not installed in the python path and you will get the following error when trying to install csstidy

scons: *** No SConstruct file found. File "/usr/local/lib/scons-1.2.0/SCons/Script/", line 826, in _main

Install CSSTidy

sudo cp release/csstidy/csstidy /usr/local/bin/

Note that the last command assumes /usr/local/bin is in your $PATH. Change it if you would like to place it in another place.