Python and hashlib module

zerkms picture zerkms · Nov 17, 2010 · Viewed 13.5k times · Source

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

Answer

Ignacio Vazquez-Abrams picture Ignacio Vazquez-Abrams · Nov 17, 2010

Install openssl-dev and rebuild.