I've just installed Python 2.6.6 from sources and what I get:
>>> import hashlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/hashlib.py", line 136, in <module>
md5 = __get_builtin_constructor('md5')
File "/usr/local/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
import _md5
ImportError: No module named _md5
Install openssl-dev
and rebuild.