Python, Virtualenv and Tkinter

A coworker was running into problems installing Matplotlib under virtualenv; while running "pip install", he saw this error:

/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld:
cannot find -ltcl

A complication was that he was using Enthough Python; when he used that directly, rather than under virtualenv, it worked just fine.

In the end it turned out to be a long-standing bug in virtualenv. This StackExchange question produced the solution, which is to add these lines to the activate script in the virtualenv:

ENTHOUGHT=/path/to/enthought
TK_LIBRARY=${ENTHOUGHT}/lib/python2.7/lib-tk:${ENTHOUGHT}lib/python2.7/site-packages/PIL
TKPATH=${ENTHOUGHT}/lib/python2.7/lib-tk:${ENTHOUGHT}/lib/python2.7/lib-tk
TCL_LIBRARY=${ENTHOUGHT}/lib/tcl8.5/
export TCL_LIBRARY TK_LIBRARY TKKPATH

Re-source the activate script, and all is well.