https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.2.1/matplotlib-1.2.1.tar.gz wget http://downloads.sourceforge.net/project/freetype/freetype2/2.4.11/freetype-2.4.11.tar.bz2 tar xfvj freetype-2.4.11.tar.bz2 && cd freetype-2.4.11 && ./configure --prefix=$INSTALL_DIR/freetype/build && make && make install $INSTALL_DIR/lib/python export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/lib/python && export CPLUS_INCLUDE_PATH=$INSTALL_DIR/freetype/build/include:$INSTALL_DIR/freetype/build/include/freetype2/ && export LIBRARY_PATH=$INSTALL_DIR/freetype/build/lib/ && python setup.py install --home $INSTALL_DIR --install-scripts $INSTALL_DIR/bin $INSTALL_DIR/lib/python Compiling matplotlib requires a C compiler (typically gcc), freetype2, numpy and libpng.