Install certbot nginx in Amazon Linux AMI

I also faced similar issue a few months back in Amazon linux. Fixed this by installing certbot via pip. The commands that I used:

pip install virtualenv
virtualenv ~/.certbot
source ~/.certbot/bin/activate
pip install 'setuptools<41'
pip install certbot
pip install 'parsedatetime<2.6'

Now simply generate the certificate by issuing below command

sudo ~/.certbot/bin/certbot certonly --webroot -w /usr/share/nginx/html/example -d example.com