ImportError: cannot import name md5 ImportError: cannot import name md5 python python

ImportError: cannot import name md5


I'm using macOS, fix this by brew unlink openssl && brew reinstall python@2


From comment, python@2 is no longer available. This may work brew unlink openssl && brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/86a44a0a552c673a05f11018459c9f5faae3becc/Formula/python@2.rb


I personally use and would recommend pyenv to manage Python versions. At first I was not sure how to fix this, and tried to re-install using brew as suggested here. However, I then recalled that I had used pyenv to install and so I was able to fix my error with.

pyenv install -f 2.7.15

The -f option forces the installation of that version even if it already exists on your system. You would need to use 2.7.16 or whatever version you would like it to use.

The python-build that pyenv uses will use the openssl library from brew if it's available.


I got this error on Python 2.7.14. Upgrading to 2.7.17 solved the issue for me.