I was working on a Ubuntu server 14.04.1, but it was painful! The hard part is, of course, virtualenv. I was finally lucky using the Qt4 backend, which I could only install through the Ubuntu package, and then had to symbolically link it to my virtualenv. So, here is a step by step process ...
Install pre-reqs first and hack PyQt4 into your virtualenv:
$ sudo apt-get install xauth x11-apps python-qt4 $ ln -s /usr/lib/python2.7/dist-packages/PyQt4 /path/to/myvenv/lib/python2.7/PyQt4
Now manually download and install SIP ( http://www.riverbankcomputing.com/software/sip/intro ) by activating your venv as follows:
$ tar xzf sip-4.16.4.tar.gz $ cd sip-4.16.4 $ python configure.py $ make $ sudo make install
Then download the tarplotlib source tarball and change the configuration setting to force it to install the Qt4 backend:
$ tar xzf matplotlib-1.4.2.tar.gz $ cp matplotlib-1.4.2/setup.cfg.template matplotlib-1.4.2/setup.cfg
Now edit setup.cfg next to line 68 as follows:
qt4agg = True
Matplotlib will now automatically install in your vein:
$ pip install -e matplotlib-1.4.2/
Now you can use SSH with the -X flag, and the graphics will load remotely!
source share