Python “pip install ” is failing with AttributeError: ‘module’ object has no attribute ‘SSL_ST_INIT’

I ran into this issue as well. The solution proposed to run pip doesn’t work because pip is broken too! I found this solved it for me:

sudo python -m easy_install --upgrade pyOpenSSL

This installed version 17.3.0 which was an upgrade to the (stock python-openssl on xenial) version ?0.15.1?. Note the massive change in version it could be they dropped the leading 0. in later versions.

Anyway, after that, pip and ansible started to work again.

Leave a Comment