title: Installing matplotlib and its dependencies without root privileges
body: <p>I want to use matplotlib on a server where I have an account <code>/myhome</code> without root privileges.</p>
  
  <p>I downloaded the matplotlib sources and tried to install it using the distutils with the user sheme, say <code>python setup.py  install --user</code>, but it returned the following message :</p>
  
  <pre><code>============================================================================
  Edit setup.cfg to change the build options
  
  BUILDING MATPLOTLIB
          matplotlib: yes [1.3.1]
              python: yes [2.7.3 (default, Jan  2 2013, 13:56:14)  [GCC
                      4.7.2]]
            platform: yes [linux2]
  
  REQUIRED DEPENDENCIES AND EXTENSIONS
               numpy: yes [version 1.6.2]
            dateutil: yes [using dateutil version 1.5]
             tornado: yes [tornado was not found. It is required for the
                      WebAgg backend. pip/easy_install may attempt to
                      install it after matplotlib.]
           pyparsing: yes [pyparsing was not found. It is required for
                      mathtext support. pip/easy_install may attempt to
                      install it after matplotlib.]
               pycxx: yes [Couldn't import.  Using local copy.]
              libagg: yes [pkg-config information for 'libagg' could not
                      be found. Using local copy.]
            freetype: no  [pkg-config information for 'freetype2' could
                      not be found.]
                 png: yes [pkg-config information for 'libpng' could not
                      be found. Using unknown version.]
  
  OPTIONAL SUBPACKAGES
         sample_data: yes [installing]
            toolkits: yes [installing]
               tests: yes [nose 0.11.1 or later is required to run the
                      matplotlib test suite]
  
  OPTIONAL BACKEND EXTENSIONS
              macosx: no  [Mac OS-X only]
              qt4agg: yes [installing, Qt: 4.8.2, PyQt4: 4.9.3]
             gtk3agg: yes [installing, version 3.2.4]
           gtk3cairo: yes [installing, version 3.2.4]
              gtkagg: no  [The C/C++ header for gtk (gtk/gtk.h) could not
                      be found.  You may need to install the development
                      package.]
               tkagg: no  [TKAgg requires Tkinter.]
               wxagg: no  [requires wxPython]
                 gtk: no  [The C/C++ header for gtk (gtk/gtk.h) could not
                      be found.  You may need to install the development
                      package.]
                 agg: yes [installing]
               cairo: yes [installing, version 1.8.8]
           windowing: no  [Microsoft Windows only]
  
  OPTIONAL LATEX DEPENDENCIES
              dvipng: yes [version 1.14]
         ghostscript: yes [version 9.05]
               latex: yes [version 3.1415926]
             pdftops: yes [version 0.18.4]
  
  ============================================================================
                      * The following required packages can not be built:
                      * freetype
  </code></pre>
  
  <p>It seemed that the package 'freetype' was missing, so I downloaded its sources, and I found that it could be installed in a specific place by running:</p>
  
  <pre><code>./configure --prefix=/myhome/somedir
  make
  make install
  </code></pre>
  
  <p>My question is: <strong>where do I install freetype so it can be detected by the distutils ?</strong></p>
  
  <p>My first thought was to install it in <code>/myhome/.local</code> because this is where the distutils install a module when using the <code>--user</code> option.
  Unfortunately, when doing this, I still got the same message as above.</p>
  
  <p>I tried something more complicated by creating a virtual environment using the virtualenv package :</p>
  
  <pre><code>virtualenv /myhome/venv/
  </code></pre>
  
  <p>Then I installed freetype in <code>myhome/venv/</code> and finally I ran the distutils within this virtual environnement, but it gave me the same message again.</p>
  
  <p>Thank you for helping, and, of course, I won't ask my sysadmin to install matplotlib for me.  </p>
  
  <p><strong>PS</strong>: something certainly unrelated with my problem but maybe worth noting : I install the freetype package by using <code>./configure --prefix=/myhome/somedir --without-png</code>. Without the <code>--without-png</code> option, I get the following error:</p>
  
  <pre><code>checking for libpng... configure: error: `libpng-config' not found;
  either set the LIBPNG_CFLAGS and LIBPNG_LDFLAGS environment variables,
  or pass `--without-png' to the `configure' script.
  </code></pre>