I ran into an issue with AWS CLI on Ubuntu 16.04. I was getting this error, “AWSHTTPSConnection’ object has no attribute ‘ssl_context” every time I try to do a simple “aws s3 ls” command. So, here’s the fix.

Assuming you installed “awscli” using apt. Go ahead and uninstall it.

<pre lang="bash">apt remove awscli

Install awscli using pip instead.

<pre lang="bash">apt install python-pip
pip install awscli
aws --version

If this is a fresh install, you may have to run “aws configure.”