Abhinav Saxena bio photo

Abhinav Saxena

a body of clay, a mind full of play, a moment's life - that is me

Twitter Facebook LinkedIn Github Flickr

While trying to install a few packages using Pip, I encountered following error: “ERROR:root:code for hash md5 was not found”. For reference, here is the stacktrace that I saw:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5


Fix
It took me a while to figure out the error is not exactly because of Python, but OpenSSL and Homebrew. Fix is quit simple, you need to switch Homebrew to use right version of open SSL.

$ ls /usr/local/Cellar/openssl  # find out which version of openssl is currently present
1.0.2q
$ brew switch openssl 1.0.2q    # and switch to that version